✓ Accepted answer
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.
3 comments
Where do you put the script?
Thanks (:
Jonny, I never provided a script, that is only pseudocode, anyway, where you put your scripts should never change. Always keep them in server scripts. It's there for a reason.