thngf

Untitled

Oct 7th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. --Anaminus
  2.  
  3. permission = {"baxterknite", "nights192", "fraklepop", ".steve3953", "....", "....."} -- Put in the names of the people allowed to spawn a teapot turret giver
  4.  
  5. function check(player)
  6. if table.maxn(permission)==0 then return true end--Remove all names from permission to allow all players to use.
  7. for i = 1,#permission do
  8. if string.lower(player.Name)==string.lower(permission[i]) then return true end
  9. end
  10. return false
  11. end
  12.  
  13.  
  14. function onPlayerRespawned(newPlayer)
  15.  
  16. if (newPlayer == nil) then return end
  17.  
  18. if not check(newPlayer) then return end
  19.  
  20. local w = game.Lighting:GetChildren()
  21. for i = 1,#w do
  22. if w[i].Name == "Spawner" then
  23. w[i]:Clone().Parent = newPlayer.Backpack
  24. end
  25. end
  26. end
  27.  
  28. function onPlayerEntered(newPlayer)
  29. newPlayer.Changed:connect(function (property)
  30. if (property == "Character") then
  31. onPlayerRespawned(newPlayer)
  32. end
  33. end)
  34. end
  35.  
  36. game.Players.PlayerAdded:connect(onPlayerEntered)
Advertisement
Add Comment
Please, Sign In to add comment