So I am messing around with an idea I had and I want to make it so every time you die your character changes between the four characters that I have in RepStorage.
I have a basic idea of I have to use Math.Random and put it into StarterPlayer and name it starter Character but I am not too great using Math.Random so I am not sure what I would do here or where to put the scripts.
If someone could help me out that'd be great!
I was about to answer this when cloudflare got hit, but anyway, it's given me time to think about this, and I believe the best way to do it is as follows:
So in rep storage, you have 4 character models, all named "StarterCharacter", keep them in a folder named something like Characters. Then in your script, do something like this:
(this is mostly pseudocode, you will have to polish it to your specifications)
local chars = RepStorage.Characters:GetChildren() game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) StarterPlayer.StarterCharacter:Destroy() chars[math.random(1,4)]:Clone().Parent = StarterPlayer end end
So you get a table of all the characters using getchildren, and then when a player's character loads in, you destroy the old one and get a new model in so that it preps it for the next time the character loads in. This way you don't need to handle anything with loading the character in yourself.