So I have 2 scripts which when you click a button, the script disables another script.
Script 1 (Checker)
local function Click(Player)
if Player.IsInGroup(group.Value) then
script.Parent.Script.Disabled = false
else
script.Parent.Script.Disabled = true
end
script.Parent.Control1.SurfaceGui.TextButton.MouseButton1Click:connect(click)
Script 2 (Door Script)
function click()
if(script.Parent.Status.Value)=="Closed" then
script.Parent.Status.Value="Opening"
movements=37
speed=0.2
for i=1,movements do
wait(0.01)
script.Parent.PLT.CFrame=script.Parent.PLT.CFrame + Vector3.new(0,speed,0);
end
script.Parent.Status.Value="Open"
elseif(script.Parent.Status.Value)=="Open" then
script.Parent.Status.Value="Closing"
movements=37
speed=0.2
for i=1,movements do
wait(0.01)
script.Parent.PLT.CFrame = script.Parent.PLT.CFrame + Vector3.new(0,-speed,0);
end
script.Parent.Status.Value="Closed"
end
end
script.Parent.Control1.SurfaceGui.TextButton.MouseButton1Click:connect(click)

1 comment
Nope