Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Destroying/removing player gui?

I have 2 player guis. In one of them I have guis.... and in the other I have..a script that we dont need to know about, a frame, and a textbutton. In the textbutton I have a script that is below! vv NOT A REQUEST! I want to know what I am doing wrong!!

-- We need this script to destroy all player guis!!!!




-- Local Script inside the button
local clicked = false

script.Parent.MouseButton1Down:connect(function()
    if clicked == false then
        clicked = true
        local timer = 10 -- timer is 10 seconds
        local p = game.Players.LocalPlayer
        while timer > 0 do -- while the timer is bigger than 0 subtract 1, every second
            wait(1)
            timer = timer - 1
            p.PlayerGui.TeleportGui.TeleportGui.Close.Text = "READ DESC. ("..timer..")" -- changing the text of the button to the cooldown, and indicates the seconds remaining till the gui is removed
        end
        p.PlayerGui.TeleportGui:Destroy()
    end
end)

1 answer

✓ Accepted answer

Does output or dev console say anything? If not, make sure the script is a Local Scripts since you're using LocalPlayer.

1 comment

0

Im not so sure.

This discussion is preserved as it was. New answers, comments, and votes are closed.