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

How would I make a character spawn with a script each time they die or join?

Startercharacterscripts do not continue to insert after death

2 comments

0

Destroy

0

Superapl1111's answer will work and is correct. However, I just did a test in play solo, server simulation, and in-game, and the LocalScript inside StarterCharacterScripts duplicated into the Character at both the start of the game and after each death.

1 answer

You could do something like this or use this:

game.Players.PlayerAdded:connect(function(Player)
	Player.CharacterAdded:connect(function(Char)
		script = game.ReplicatedStorage.TheScriptIWantToCloneToCharacter:Clone()
		script.Parent = Char
	end
end

4 comments

0

Wont this only fire on the initiial join?

0

The characteradded thing is an event. Events fire everytime the happen, given that the event still exists/is listening, of which it is here

0

why don't you just put the script in StarterPlayerScripts/StarterCharacterScripts

0

@vacuum_cleaner as Pejorem said, this event will fire function each time a character spawns. @abnotaddable Please read the question. That's the point he/she is having problem.

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