Advertisement
boxvader

Untitled

May 6th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. hook.Add( "Think", "bankStrip", function()
  2. local inBox = ents.FindInBox( Vector(2839.968750, 1360.031250, 77.031250) , Vector(1979.031250, 1755.968750, 77.031250) )
  3. local tempPlayer = {}
  4. for i,v in ipairs(inBox) do
  5. if v:IsPlayer() then -- Checking if the entity is a player
  6. if team.GetName(v:Team()) == "Administrator" then return end
  7. if !table.HasValue(people3, v) then -- Checking if they are already in the people table
  8.  
  9. print("This section ran")
  10. local guns = v:GetWeapons()
  11. local gunNames = {}
  12. local fstop = false
  13. for k,g in pairs(guns) do
  14. if g:GetClass() == "lockpick" then v:StripWeapon("lockpick") fstop = true end
  15. end
  16. if fstop == false then return end
  17. table.insert(people3, v) -- Saving the player
  18. end
  19. table.insert(tempPlayer, v) -- Temporary table of players found inside the box during this think interation
  20. end
  21. end
  22.  
  23. -- Calculates who is no longer inside the box that was previously there
  24. local numSave = {}
  25. for i,v in ipairs(people3) do
  26. local flag = false
  27. for h,x in ipairs(tempPlayer) do
  28. if x == v then flag = true end
  29. end
  30. if flag == false then
  31. table.insert(numSave, i)
  32. end
  33. end
  34.  
  35.  
  36. for i,v in ipairs(numSave) do
  37. people3[v]:Give("lockpick")
  38. table.remove(people3, v)
  39. end
  40. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement