How do I get certain people to go through a door? Is there like a script for it? Something like a VIP door but just with 3 certain people . . . Please help , thanks.
COMMUNITY QUESTION
How do I get certain people to go through a door?
1 answer
Make sure you put this script inside the door.If this doesn't work I'll fix it.
CertainPeople = {"Bob","Kozero","CertainPerson"} -- change this to the name of the person the personal door belongs to
door=script.Parent
function onTouched(hit)
local character = hit.Parent
if character:FindFirstChild("Humanoid") then
for i,v in pairs(CertainPeople) do
if v == character.Name then
door.CanCollide = false
door.Transparency = 0.5
wait(4) -- You can change the number to the amount of seconds you want the door to be open
door.CanCollide = true
door.Transparency = 0
else
character:BreakJoints() -- remove this line if you want a non-killing door
end
end
end
end
script.Parent.Touched:connect(onTouched)
This discussion is preserved as it was. New answers, comments, and votes are closed.
