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

Why isn't my AllowedPlayer door script not working?

Asked by 10 years ago
local AllowedPlayers = ("McGreenzy, Poppu000, nobuok, jimbav1, Roboy5857")

Door = game.Workspace.Stand.Door

function onTouched(Door)
    if AllowedPlayers:onTouched(Door) then
        Door.Transparency = .5
        Door.CanCollide = false
        wait(1)
        Door.Transparency = .1
        wait(2)
        Door.Transparency = 0
        Door.CanCollide = true
    end
end

So I have a door. The usernames on the script is the people allowed to enter the door. But, it's not working. Why??? D:

1 answer

Log in to vote
-2
Answered by 10 years ago

All the names must be followed with a "", Heres The right way:

local AllowedPlayers = {"McGreenzy", "Poppu000",  "Nobuok", "Jimbav1", "Roboy5957"}


Door = game.Workspace.Stand.Door


function OnTouched(Door)
if AllowedPlayers:onTouched(Door) then
Door.Transperancy = 0.5 -- It has to have 0.5.
Door.CanCollide = false
wait(1) -- or wait() same thing.
Door.Transperancy = 0.1
wait(2)
Door.Transperancy = 0
Door.CanCollide = true
       end
end


-- If It dosent work still its beacuse AllowedPlayers:onTouch(Door) isnt a connect method.
Ad

Answer this question