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

GUI popup only 1 time when I close it, any help?

Asked by 4 years ago

Hello, I am trying to show and then hide a GUI when a variable is a certain amount, when it close the first time then the GUI doesnt reappear anymore. Any help?

0
Can you include your script? Spjureeedd 385 — 4y
0
Done Giorgio2003b 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Enable:

local tool = script.Parent
local player = script.Parent.Parent.Parent
local player2 = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)

tool.Activated:Connect(function()
    player.PlayerGui.PCGui.PCBackpackFull.Visible = true
end)

Disable:

local db = true
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
    if db == true then
        db = false
        player.PlayerGui.PCGui.PCBackpackFull.Visible = false
        wait(1)
        db = true
    end
end)
Ad

Answer this question