Recent Posts

Pages: [1] 2 3 ... 10
I also tried this but every time it would say that the OW(Old Weapon) it is not equal to weapon_physgun, gmod_tool, or gmod_camera and it would run the code in the if statement no matter what. Maybe I am comparing the OW to the weapons wrong??

Code: Lua
  1. local function PlayerWeapons(ply , OW , NW)
  2.         if OW ~= weapon_physgun then
  3.                 print ("It Worked!")
  4.                 SP = false end
  5.         if OW ~= gmod_tool then
  6.                 SP = false end
  7.         if OW ~= gmod_camera then
  8.                 SP = false
  9.                 print(OW)end
  10. end
  11. hook.Add("PlayerSwitchWeapon", "UName" , PlayerWeapons)
So, I am working on a spawn protect addon and I am trying to make it so that when the player pulls out a weapon the spawn protect will go away. I would like the spawn protect to stay on when they spawn a weapon on the ground. I just want it to go off when they pull anything out other than the physics gun, tool gun, and camera. I can't figure out a way to compare the wepon that a player is holding to the weapons that I want to not be considered a weapon. I am new to LUA and this is all that I have come up with for this section of it. Any help would be  :)

Code: Lua
  1. local function GetWeapon()
  2.         local ply = LocalPlayer()
  3.         local wep = ply:GetActiveWeapon()
  4.         if(!wep.IsValid()) then return false end
  5.         if wep ~= weapon_physgun then
  6.                 SP = false end
  7.         if wep ~= gmod_tool then
  8.                 SP = false end
  9.         if wep ~= gmod_camera then
  10.                 SP = false end
  11.         print(wep)
  12. end
Suggestions / Screengrab
« Last post by KewlerGames on Today at 12:33:36 PM »
ULX formed working screengrab? So I've seen posts about this is in the past and recently as I bought a server and am now starting to do well in a player base that also means there will be cheaters CAC can only do so much as I had a friend test it and it only caught him 8/10 times so I need something that is a bit more accessible if you see a cheater (as staff)
What I mean is I just need screengrab to work with ulx if at all possible
Developers Corner / Re: (Help) ULX gotocar command
« Last post by JamminR on Yesterday at 06:59:54 PM »
Well, start by looking at the code. Then figure out how to get the position of the car.
There may not be an "easy" way to determine the name of any car in gmod using lua, but, perhaps you're working with a SENT that already has listed cars in some sort of table.
From there, list the code you've developed and the errors. Pay close attention to lua errors - they tell you exact line issues normally.
Developers Corner / (Help) ULX gotocar command
« Last post by An0n on Yesterday at 02:48:16 PM »
I have tried to make my own !gotocar command, but I simply don't know what I should put in, I've watched a tutorial... “ Custom Commands In ULX “ that was just a video of a guy doing !respawn <playername>. If someone could help me, it would be much appreciated.
Developers Corner / Re: [Help] Gamemode in TTT using excisting commands
« Last post by iViscosity on November 15, 2017, 03:52:57 PM »
Yeah I don't plan to just write something and give it to someone without giving them the chance to learn. In fact, I wasn't planning to 100% write it for them, but give them the pseudo-code that will allow them to write it and make it their own.

Developers Corner / Re: [Help] Gamemode in TTT using excisting commands
« Last post by JamminR on November 15, 2017, 03:09:57 PM »
iViscosity - Though you might be planning to already, make sure to comment every line of code, even including the ulx parameters, so that Wolviller111 can learn/understand what they are doing.
(Bonus for links to ULib docs and Gmod lua wiki docs for commands/setups being used)
Developers Corner / Re: [Help] Gamemode in TTT using excisting commands
« Last post by Wolviller111 on November 15, 2017, 11:31:42 AM »
No thank you. Only for the next round will do just fine ^^
Developers Corner / Re: [Help] Gamemode in TTT using excisting commands
« Last post by iViscosity on November 15, 2017, 11:07:28 AM »
Yeah that shouldn't be too hard. Just a command that can trigger a variable that will add a hook to assign roles. Do you want it only for the next round or until it's turned off?
Off-Topic / Re: Cant Type in Chat
« Last post by GeorgeHennen on November 14, 2017, 09:17:19 PM »
By any chance was this fixed? If so give us the reason why so you could help the community.
Pages: [1] 2 3 ... 10