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

How do you make a clone only ONCE, once a player joins ?

local gui = script.Intro:Clone()
game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:wait()
	gui:Clone().Parent = player.PlayerGui
end)

this is the clone script, when player joins he gets gui. when he dies he shouldn't get it, but when he respawns the gui clones back in. help please

1 answer

✓ Accepted answer
local gui = script.Intro:Clone()
game.Players.PlayerAdded:connect(function(player)
local deb = false  -- debounce
    player.CharacterAdded:wait()
if deb == false then
    gui:Clone().Parent = player.PlayerGui
deb = true
end
end)

3 comments

0

you do not understand. Debounce does not stop the cloning i asked to make the cloning ONLY clone then when player joins ONCE for him then never again happening again. and if he dies it wouldn't do that too.

0

btw, it doesn't work even if in a LocalScript..

0

nvm i fixed it thx!

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