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)
Problem 1, Missing closing for the function
function Click(Player) if Player.IsInGroup(group.Value) then script.Parent.Script.Disabled = false else script.Parent.Script.Disabled = true end end script.Parent.Control1.SurfaceGui.TextButton.MouseButton1Click:connect(click)
Problem 2, Player:IsInGroup() not . It's a function so you need :
function Click(Player) if Player:IsInGroup(group.Value) then script.Parent.Script.Disabled = false else script.Parent.Script.Disabled = true end end script.Parent.Control1.SurfaceGui.TextButton.MouseButton1Click:connect(click)
if it works loike and accept You forgot to close the function, if any other problems occur comment and I'll edit accordingly if it worked +1 and accept
local groupid = "put your group id here" function Click(Player) if Player:IsInGroup(groupid) then script.Parent.Script.Disabled = false else script.Parent.Script.Disabled = true end end script.Parent.Control1.SurfaceGui.TextButton.MouseButton1Click:connect(click)
You need a click detector, Then add a function.
Button.Lighting.ClickDetector.IfTrue then FindFirstChild:Destroy
Hope this helped