ok title explain rly simple script but it doesnt work
local yes = true local plr = game.Players:WaitForChild(game.Workspace:WaitForChild("PlayerName")).Value local plrgui = game.StarterGui script.Parent.MouseButton1Click:Connect(function() if yes then local crates = plrgui.Crates.Crates local crates2 = plrgui.Crates.CurrentCrate yes = false if crates.Visible == false then crates.Visible = true crates2.Visible = true elseif crates.Visible == true then crates.Visible = false crates2.Visible = false end wait(0.5) yes = true end end)
I think its just some variable issues; this should hopefully fix the problem. Accept if it helps!
local yes = true local plr = game:GetService("Players").LocalPlayer local plrgui = Player.PlayerGui.ScreenGui script.Parent.MouseButton1Click:Connect(function() if yes then local crates = plrgui.Crates.Crates local crates2 = plrgui.Crates.CurrentCrate yes = false if crates.Visible == false then crates.Visible = true crates2.Visible = true elseif crates.Visible == true then crates.Visible = false crates2.Visible = false end wait(0.5) yes = true end end)