How to give each player a different StarterCharacter?

Hey, I’m working on a game and I have a problem. There are several car models and I wrote a script that gives each player a unique car when they join the game, making the car unavailable for other players until the player leaves the game resulting in every player having a different car.

However, I don’t know how to set the car model as the specific players starter character. Does anybody know how to set the players character to a model when they join and keep that model when they die without other players having the same startercharacter?

You could try to set the player.Character to the car model after their character is added, example:

local Cars = game.ReplicatedStorage.Cars:GetChildren() -- wherever you keep your car models
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
local car = Cars[math.random(1, #Cars)]:Clone()
car.Parent = workspace
player.Character = car
end)
end)

However, if this doesn’t work, you could try making the car model locally the StarterCharacter, making it different for every player.

Thanks but how do you track the players camera with the new character? I can control the car now but my camera is somewhere up in the air

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.