I have a folder in ReplicatedStorage named 'StarterChars', I need help making it to where you get a random StarterCharacter when you spawn. Any help would be greatly appreciated.
COMMUNITY QUESTION
How would I make it to where I can randomize the 'StarterCharacter'?
1 answer
-- Clone one of the starter characters into Game.StarterPlayer and rename it to "StarterCharacter" so the first player who joins actually gets set as a starter character.
local StarterCharacters = {
game.ReplicatedStorage.StarterChars.StarterCharacter1,
game.ReplicatedStorage.StarterChars.StarterCharacter2,
game.ReplicatedStorage.StarterChars.StarterCharacter3
}
while wait(0.5) do
if game.StarterPlayer:FindFirstChild("StarterCharacter") then
game.StarterPlayer.StarterCharacter:Destroy()
end
local Randomize = StarterCharacters[math.random(1, #StarterCharacters)]:Clone()
Randomize.Name = "StarterCharacter"
Randomize.Parent = game.StarterPlayer
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I'm quite new to scripting, would I put this in a ServerScript located in Workspace?
You would put this in your local player