Advertisement
yaay

Untitled

Jul 3rd, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. print("VIP Door Script loaded")
  2.  
  3. -- list of account names allowed to go through the door.
  4. permission = { "chucky_100", "Dialga2000251" , "builderman" , "MichaelG" , "Funkygirl1" , "ROBLOX" , "Jackthepirate95" , "Are92" , "Telamon" , "clockwork" } --Put your friends name's here. You can add more.
  5.  
  6. function checkOkToLetIn(name)
  7. for i = 1,#permission do
  8. -- convert strings to all upper case, otherwise we will let in,
  9. -- "Username," but not, "username," or, "uSERNAME."
  10. -- Why? Because, "Username," is how it is spelled in the permissions.
  11. if (string.upper(name) == string.upper(permission[i])) then return true end
  12. end
  13. return false
  14. end
  15.  
  16. local Door = script.Parent
  17.  
  18. function onTouched(hit)
  19. print("Door Hit")
  20. local human = hit.Parent:findFirstChild("Humanoid")
  21. if (human ~= nil ) then
  22. -- a human has touched this door!
  23. print("Human touched door")
  24. -- test the human's name against the permission list
  25. if (checkOkToLetIn(human.Parent.Name)) then
  26. print("Human passed test")
  27. Door.Transparency = 0.7
  28. Door.CanCollide = false
  29. wait(4) -- this is how long the door is open
  30. Door.CanCollide = true
  31. Door.Transparency = 0
  32. else human.Health= 0 -- delete this line of you want a non-killing VIP door
  33. end
  34. end
  35. end
  36.  
  37. script.Parent.Touched:connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement