I need help destroying 2 player guis! I have 1 playergui (named "Buttons") w/ nothing to know about and another one named "TeleportGui", it has a TextButton inside it. It is named "Ready" I want when I click "Ready" every single PlayerGuis will get removed or destroyed.
Below is a local script inside the textbutton.
-- 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)
This is not working! Help!

2 comments
You didn't specify the problem with the script? What does it do? Does it work partially or not at all? Is there an error in the output?
I have edited it