Hello, I have created 4 player models hat I want to act as "Default" characters for my game. To try and do this, I set up this script:
local characters local clone function onPlayerEntered(player) characters = math.random(4) if characters == 1 then clone = script.StarterCharacter1:Clone() clone.Name = "StarterCharacter" clone.Parent = game.StarterPlayer elseif characters == 2 then clone = script.StarterCharacter2:Clone() clone.Name = "StarterCharacter" clone.Parent = game.StarterPlayer elseif characters == 3 then clone = script.StarterCharacter3:Clone() clone.Name = "StarterCharacter" clone.Parent = game.StarterPlayer elseif characters == 4 then clone = script.StarterCharacter4:Clone() clone.Name = "StarterCharacter" clone.Parent = game.StarterPlayer end end game.Players.PlayerAdded:connect(onPlayerEntered)
The problem is that every player has the same character, I want there to be a mix of the 4 characters I have created
You can use math.randomseed(tick())
in the first line of your script to generate new random seed every time
Also, use math.random(1,4)
to generate number from 1 to 4