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 4 years ago

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)

1 answer

Log in to vote
1
Answered by 4 years ago

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)
0
there ya go TFlanigan 86 — 4y
Ad

Answer this question