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

If function is triggered more than once, after 20s of the first function they all disappear?

Is there anyway to clone the gui to make it so it doesnt disappear? Here is the script:

local statusDom = game.ReplicatedStorage.StatusDom
local text = script.Parent.TextLabel
servermusic = game.Workspace.Sounds.new_summer
ding = game.Workspace.Sounds.Celebration

statusDom.Changed:Connect(function()
script.Parent.Enabled = true
text.Text = statusDom.Value
wait(20)
script.Parent.Enabled = false
end)

Basically I would like to add a tween to the gui in future so they dont overlap, but say if the function istriggered three times, the second and third one 10 seconds after the original one. When the original UI has been on screen for 20 seconds they all disappear. Help?

1 answer

Ive tried this too and it hasnt worked:

local statusDom = game.ReplicatedStorage.StatusDom
local text = script.Parent.TextLabel
servermusic = game.Workspace.Sounds.new_summer
ding = game.Workspace.Sounds.Celebration

statusDom.Changed:Connect(function()
local clone = script.Parent:Clone()
clone.Parent = game.StarterGui
clone.Enabled = true
clone.TextLabel.Text = statusDom.Value
wait(20)
clone.Enabled = false
end)

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