Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why this frame visibility changing script isnt working?

Asked by 5 years ago

ok title explain rly simple script but it doesnt work

01local yes = true
02local plr = game.Players:WaitForChild(game.Workspace:WaitForChild("PlayerName")).Value
03local plrgui = game.StarterGui
04script.Parent.MouseButton1Click:Connect(function()
05    if yes then
06        local crates = plrgui.Crates.Crates
07        local crates2 = plrgui.Crates.CurrentCrate
08        yes = false
09        if crates.Visible == false then
10            crates.Visible = true
11            crates2.Visible = true
12        elseif crates.Visible == true then
13            crates.Visible = false
14            crates2.Visible = false
15        end
16        wait(0.5)
17        yes = true
18    end
19end)

1 answer

Log in to vote
1
Answered by 5 years ago

I think its just some variable issues; this should hopefully fix the problem. Accept if it helps!

01local yes = true
02local plr = game:GetService("Players").LocalPlayer
03local plrgui = Player.PlayerGui.ScreenGui
04script.Parent.MouseButton1Click:Connect(function()
05    if yes then
06        local crates = plrgui.Crates.Crates
07        local crates2 = plrgui.Crates.CurrentCrate
08        yes = false
09        if crates.Visible == false then
10            crates.Visible = true
11            crates2.Visible = true
12        elseif crates.Visible == true then
13            crates.Visible = false
14            crates2.Visible = false
15        end
16        wait(0.5)
17        yes = true
18    end
19end)
0
there ya go TFlanigan 86 — 5y
Ad

Answer this question