Hello, I have made 5 different starter characters, and I want to make them different to each player that spawns, how can i make that?
Put the starter characters in a folder in ReplicatedStorage, named 1 for the first, 2 for the second, etc then put a LocalScript under StarterPlayerScripts that says
local repStorage = game:GetService("ReplicatedStorage")
local folder = repStorage:WaitForChild("Put your folder name here")
local randChar = math.random(1, #folder:GetChildren())
local charPicked = folder:FindFirstChild(randChar):Clone()
charPicked.Parent = game:GetService("StarterPlayer")
charPicked.Name = "StarterCharacter"
Disclaimer: I haven’t tested the script yet, but it should work.
Remember to put the name of the folder over Put your folder name here
in line 2
It didn’t worket at first, but I managed how to fix that, thanks
Great! Glad to help.
Could I know what didn’t work? I would be glad to edit the script so other people can use it easily.
What didn’t work?
It’d be a great help if you’d say
I tested the script with the output window; Nothing showed up.
I opened the StarterPlayer Folder, everything was fine and the startercharacter was there, and i tried moving the localscript from StarterPlayerScripts to StarterCharacterScripts and nothing really happened.
I cant get it to work, what did you do to fix it ?
Also wondering how you were able to fix this, this script seems really useful to the game I am currently working on.
Same, let me know if you find i fix, since i havn’t !
I know I am late but could I know how you fixed the script?
Nobody knows.
Isn’t that just sad?
Nobody knows…
he just left? wow
30 words rn 30 words rn
Oh guys i figured it out for y’all
Easiest way to do it:
1. Create Folder in ServerStorage called StarterCharacters
2. Put your characters in this folder
3. Make sure to name them from 1 to for example 10 so 1 2 3 etc.
4. Create Script in ServerScriptService called randomizeCharacter
5. Paste it into the script:
local ServerStorage = game:GetService("ServerStorage")
local StarterCharacters = ServerStorage:WaitForChild("StarterCharacters")
game.Players.PlayerAdded:Connect(function(player)
local randomCharacterNumber = math.random(1, #StarterCharacters:GetChildren())
local randomCharacter = StarterCharacters[randomCharacterNumber]
player.CharacterAdded:Connect(function(character)
local Humanoid = character:WaitForChild("Humanoid")
Humanoid:ApplyDescription(randomCharacter.Humanoid.HumanoidDescription)
for _, accessory in pairs(randomCharacter:GetChildren()) do
if accessory:IsA("Accessory") then
accessory:Clone().Parent = character
end
end
end)
end)
6. Enjoy