Hi guys, I created a door that opens with a button that needs to be clicked with the mouse, but now I need this door to be opened and closed only by one team. How can I do?
This is the button code:
function onClicked()
if script.Parent.Parent.Power.Value == true then
if script.Parent.Parent.Valid.Value == true then
script.Parent.Parent.Valid.Value = false
if script.Parent.Parent.Active.Value == false then
script.Parent.Parent.Active.Value = true
elseif script.Parent.Parent.Active.Value == true then
script.Parent.Parent.Active.Value = false
end
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
