I want to open and close an gui using an clicking detector and close it with an button gui , I want it client side , it work just once
open script (normal script):
local teams = game:GetService("Teams")
local team1 = teams.Teacher
game.Players.PlayerAdded:Connect(function(plr)
if plr.Team == team1 then
script.Parent.MouseClick:Connect(function()
plr.PlayerGui.CanvasGui.Enabled = true
end)
end
end)
Im not sure but i think click detectors cant be used on local scripts if the parent is the click detector, try with a server script and check if it works.
or maybe this can be the close script if the I did above doesn’t work
local teams = game:GetService("Teams")
local team1 = teams.Teacher
game.Players.PlayerAdded:Connect(function(plr)
if plr.Team == team1 then
script.Parent.MouseClick:Connect(function()
plr.PlayerGui.CanvasGui.Enabled = false
end)
end
end)