• Print

Author Topic: immunity to props [lua help]  (Read 4276 times)

0 Members and 1 Guest are viewing this topic.

Offline Patrick Palson

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
immunity to props [lua help]
« on: December 20, 2016, 03:07:34 am »
not sure where these kind of requests go or if they are even accepted.

so, i wanted to setup immunity to props, using tables, so if your rank matched the table and you were trying to pickup a prop from another usergroup detected by a table then it would not allow you to pick it up, problem is that it wont work at all

i hardly know any lua so please tell me if this is all wrong, dont just lay down an entire answer for me, i came to the forums to learn not for people to do my work, if its all wrong pls tell me what im doing thats incorrect.

Code: Lua
  1. --This is where your immunity is.
  2. --Example: immunity1 cannot interact with immunity2 and up.
  3. local immunity0 = {"user"}
  4. local immunity1 = {"moderator"}
  5. local immunity2 = {"admin"}
  6. local immunity3 = {"Developer"}
  7. local immunity4 = {"superadmin"}
  8. local immunity5 = {"owner"}
  9.  
  10. --DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW HOW LUA WORKS!!!
  11. function PlayerPickedUpProp( ply, ent )
  12. if ( ply:IsUserGroup(immunity3) and ent:GetOwner():IsUserGroup(immunity2) ) then
  13. return false end
  14. end
  15. hook.Add( "PhysgunPickup", "PlayerPickedUpProp", PlayerPickedUpProp )

thanks!!!
if it helps, these groups are from ulx hence the reason its IsUserGroup
« Last Edit: December 20, 2016, 03:13:15 am by Patrick Palson »

  • Print