Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isn't my AllowedPlayer door script not working?

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

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.