Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get certain people to go through a door?

Asked by 10 years ago

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.

1 answer

Log in to vote
3
Answered by
Kozero 120
10 years ago

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)

Ad

Answer this question