I need to create a door that upon clicking it will open and you can go through it, but only people that I specify can get in it. Here is the script, but I need the extension so only specific people can open it.
local isOn = true
local listOfPlayersUserIdsWhoCanEnter = {
[40098276] = true
}
function on()
script.Parent.Transparency = 0
script.Parent.CanCollide = true
script.Parent.Texture.Transparency = 0
end
function off()
script.Parent.Transparency = 1
script.Parent.CanCollide = false
script.Parent.Texture.Transparency = 1
end
function onClicked(plr)
if not listOfPlayersUserIdsWhoCanEnter[plr.UserId] then return end
if isOn then
off()
else
on()
end
isOn = not isOn
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)
on()