ok title explain rly simple script but it doesnt work
01 | local yes = true |
02 | local plr = game.Players:WaitForChild(game.Workspace:WaitForChild( "PlayerName" )).Value |
03 | local plrgui = game.StarterGui |
04 | script.Parent.MouseButton 1 Click:Connect( function () |
05 | if yes then |
06 | local crates = plrgui.Crates.Crates |
07 | local crates 2 = plrgui.Crates.CurrentCrate |
08 | yes = false |
09 | if crates.Visible = = false then |
10 | crates.Visible = true |
11 | crates 2. Visible = true |
12 | elseif crates.Visible = = true then |
13 | crates.Visible = false |
14 | crates 2. Visible = false |
15 | end |
16 | wait( 0.5 ) |
17 | yes = true |
18 | end |
19 | end ) |
I think its just some variable issues; this should hopefully fix the problem. Accept if it helps!
01 | local yes = true |
02 | local plr = game:GetService( "Players" ).LocalPlayer |
03 | local plrgui = Player.PlayerGui.ScreenGui |
04 | script.Parent.MouseButton 1 Click:Connect( function () |
05 | if yes then |
06 | local crates = plrgui.Crates.Crates |
07 | local crates 2 = plrgui.Crates.CurrentCrate |
08 | yes = false |
09 | if crates.Visible = = false then |
10 | crates.Visible = true |
11 | crates 2. Visible = true |
12 | elseif crates.Visible = = true then |
13 | crates.Visible = false |
14 | crates 2. Visible = false |
15 | end |
16 | wait( 0.5 ) |
17 | yes = true |
18 | end |
19 | end ) |