Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I create a custom character loading system? [closed]

Asked by
LawlR 182
6 years ago

I read on the wiki that if you want individual players to have different StarterCharacters, you'd need to create a custom character loading system. How do I do this?

0
I was wondering a similar thing, how do you set what the player is wearing? And can you make them wear something as a hat, like a model you made. Boss246813579 -6 — 6y

Closed as Not Constructive by lukeb50, whenallthepigsfly, User#20388, and Programical

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
F_F 53
6 years ago

You need a custom character named StarterCharacter. Parent StarterCharacter to StarterPlayer.

I am assuming what you need to do is the following:

go to Players and set the CharacterAutoLoads to false

local RespawnTime = 2

game.Players.PlayerAdded:Connect(function(Player) -- PlayerAdded event Player:LoadCharacter () -- in this case, we have to load the character because CharacterAutoLoads property is set to false.

Player.CharacterAdded:Connect(function(Character) -- Once the character is added we will run this function
    local Humanoid = Character:WaitForChild("Humanoid")

    Humanoid.Died:Connect(function()
        wait(RespawnTime) -- time until next respawn
        Player:LoadCharacter() -- add their character again
    end)
end)

end)

0
When you parent StarterCharacter to StarterPlayer, it makes every player have that character. LawlR 182 — 6y
Ad