luarobloxluauroblox-studio

How to Apply the Same Skin to All Players in Roblox?


I am experimenting in Roblox Studio, and I want to create a logic that would give all players the same skin. (All players must look the same during gameplay.)

I found two options:

First option: Drag the model to ReplicatedStorage and add the following script to ServerScriptService

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local newSkin = ReplicatedStorage:WaitForChild("NewSkinModel")

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        character:WaitForChild("Humanoid")
        
        local newCharacter = newSkin:Clone()
        newCharacter.Name = player.Name
        
        local humanoid = newCharacter:WaitForChild("Humanoid")
        humanoid:ApplyDescription(player.Character.Humanoid:GetAppliedDescription())
        
        player.Character = newCharacter
        newCharacter.Parent = workspace
    end)
end)

Second option: Upload the model to StarterPlayer.

But unfortunately neither option helps me. I tried to find issues in the code, but I couldn't find anything.


Solution

  • Option 2 is by far the easiest. What you seem to be missing is that if you want the model to be the default character, it has to be named "StarterCharacter" instead of "NewSkinModel".

    This is because when Roblox chooses a character model, it doesn't just choose the first Model that contains a Humanoid object. It specifically looks for one named "StarterCharacter", ignoring anything that doesn't have that name.

    If you rename your model and drag it back into StarterPlayer, your game should work as expected.