Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I clear character appearance and set the same avatar for all players in my game?

Here is the script I did, but it's not working and isn't changing the avatar, but is clearing the appearance.

game.Players.LocalPlayer.Character.ChildRemoved:connect(function(child)
  print(child.ClassName, 'removed from character')
end)
 
	

game.Players.LocalPlayer:ClearCharacterAppearance()
--> BodyColors removed from character
--> ShirtGraphic removed from character
--> Shirt removed from character
--> Pants removed from character
--> CharacterMesh removed from character
--> Hat removed from character
--> Shirt removed from character

local player = game:GetService("Players").LocalPlayer -- Gets the clients player

player.CharacterAppearanceLoaded:Connect(function() -- Fires when all assets on character is loaded
    game.Players.LocalPlayer:ClearCharacterAppearance() -- Clears Appearance
    for _,BodyPart in pairs(player.Character:GetChildren()) do -- Loops through the characters body
        if BodyPart:IsA("BasePart") then -- Checks if the BodyPart variable is an actual part
            BodyPart.BrickColor = BrickColor.new("Black") -- Changes the body part to Bright Yellow
        end
    end
end)
game.Players.PlayerAdded:connect(function(player) -- Hat adder
    repeat wait()until player.Character
    local hatId = 168167370 -- Find the ID of the hat
    local hat = game:service("InsertService"):LoadAsset(hatId):GetChildren()[1]
    hat.Parent = player.Character
end)

game.Workspace.ChildAdded:connect(function(plr) --Pants and body adder
    local name = plr.Name
    local playerinplayers = game.Players:FindFirstChild(plr.Name)
     playerinplayers.CanLoadCharacterAppearance = false
     plr.Head.face.Texture = "rbxassetid://173789498" --Find an ID of a decal for your face.
     local shirt = Instance.new("Shirt", plr)
     shirt.ShirtTemplate = "rbxassetid://295960485" -- Find the ID of the shirt
    local pants = Instance.new("Pants", plr)
    pants.PantsTemplate = "rbxassetid://128946130" -- Find the ID of the pants
end)

game.Players.PlayerAdded:connect(function(player)
    local appearanceOverride = game.Players:FindFirstChild(player.Name)
    appearanceOverride.CanLoadCharacterAppearance = false
end)


3 comments

0
  1. You didn't make that 2) You didn't tell an error/question so we will not answer
0

Yes I made that

0

You didn't make that script, even if you said you did why is there comments in it?

1 answer

✓ Accepted answer

Well, there is a much more simple way in doing this.

  1. Change your character to what you want it to look like
  2. Play Solo
  3. Select your character in Workspace
  4. Check "Archivable" (in properties tab)
  5. Copy the character
  6. Paste the character in "StarterPlayer"
  7. Name the character "StarterCharacter"

And you're done!

2 comments

0

How do u copy the character

0

nvm

This discussion is preserved as it was. New answers, comments, and votes are closed.