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

how do i make a player spawn in as a certain avatar?

Asked by 7 years ago

I need the players to spawn in as a blank character, and later customize it, how do i do this?

2 answers

Log in to vote
2
Answered by 7 years ago

Go to StarterPlayer and uncheck LoadCharacterAppearance in Properties

Ad
Log in to vote
1
Answered by 7 years ago

You can go to StarterPlayer and uncheck LoadCharacterAppearance in Properties

or if you want to do it with a script you can use a generic loop and have it destroy the aspects that customizes the character

game:GetService("Players").PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        humanoid = character:WaitForChild("Humanoid")
        for _, v in ipairs(character:GetChildren()) do
            if v:IsA("Accessory") or v:IsA("BodyColors") or v:IsA("Pants") or v:IsA("Shirt") then
                v:Destroy()
            elseif v:IsA("Part") then
                v.BrickColor = BrickColor.new("putcolorhere")
        end
    end)
end)

If you also want the face to be set default from the script here's the modified version that removes the face (you'll have to find the default face asset ID and put it there)

game:GetService("Players").PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        humanoid = character:WaitForChild("Humanoid")
        for _, v in ipairs(character:GetChildren()) do
            if v:IsA("Accessory") or v:IsA("BodyColors") or v:IsA("Pants") or v:IsA("Shirt") then
                v:Destroy()
            elseif v:IsA("Part") and not v.Name == "Head" then
                v.BrickColor = BrickColor.new("putcolorhere")
            elseif v.Name == "Head" then
                if v:FindFirstChild("face") then -- if face is not the name of the decal change it to the correct name since i wouldn't know what the face decal is called
                    v.face.Texture = "" -- add asset id, also if texture isn't the correct property, change it since I don't really work with decals that much
            end
        end
    end)
end)

Answer this question