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

Removing previous active Gui?

Asked by 9 years ago

Hello, I have here a script that pops up a Gui from the model it is in, I was wondering how or what I would add to have the script delete a previous Gui that was still active before it so, that this would destroy the previous rather than both being active.

Popup = script.Parent.Message
Ready = true
function onTouch(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil and Ready == true then
Ready = false
local plyr = game.Players:FindFirstChild(h.Parent.Name)
local c = Popup:clone()
c.Parent = plyr.PlayerGui
wait(8)
c:remove()
wait(50)
Ready = true
end
end

script.Parent.Touched:connect(onTouch)

1 answer

Log in to vote
0
Answered by 9 years ago

That didn't seem to do anything, I added it into the script and added it to a separate script, both didn't work. Thanks anyways.

Ad

Answer this question