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

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

Asked by 7 years ago

Startercharacterscripts do not continue to insert after death

0
Destroy BlackOrange3343 2676 — 7y
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. SteamDemand 312 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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
0
Wont this only fire on the initiial join? vacuum_cleaner 0 — 7y
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 Pejorem 164 — 7y
0
why don't you just put the script in StarterPlayerScripts/StarterCharacterScripts abnotaddable 920 — 7y
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. superalp1111 662 — 7y
Ad

Answer this question