Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("VIP Door Script loaded")
- -- list of account names allowed to go through the door.
- permission = { "chucky_100", "Dialga2000251" , "builderman" , "MichaelG" , "Funkygirl1" , "ROBLOX" , "Jackthepirate95" , "Are92" , "Telamon" , "clockwork" } --Put your friends name's here. You can add more.
- function checkOkToLetIn(name)
- for i = 1,#permission do
- -- convert strings to all upper case, otherwise we will let in,
- -- "Username," but not, "username," or, "uSERNAME."
- -- Why? Because, "Username," is how it is spelled in the permissions.
- if (string.upper(name) == string.upper(permission[i])) then return true end
- end
- return false
- end
- local Door = script.Parent
- function onTouched(hit)
- print("Door Hit")
- local human = hit.Parent:findFirstChild("Humanoid")
- if (human ~= nil ) then
- -- a human has touched this door!
- print("Human touched door")
- -- test the human's name against the permission list
- if (checkOkToLetIn(human.Parent.Name)) then
- print("Human passed test")
- Door.Transparency = 0.7
- Door.CanCollide = false
- wait(4) -- this is how long the door is open
- Door.CanCollide = true
- Door.Transparency = 0
- else human.Health= 0 -- delete this line of you want a non-killing VIP door
- end
- end
- end
- script.Parent.Touched:connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement