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

Destroying/removing player gui?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

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

Log in to vote
0
Answered by 9 years ago

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

0
Im not so sure. FiredDusk 1466 — 9y
Ad

Answer this question