I just want every player to be wearing a specific shirt. I figured I could put a script in StarterPlayerScripts and I know how to set a humanoid’s shirt but I don’t know how StarterPlayerScripts works and I dont know how to run the script on the player every time they spawn/respawn.
4 Likes
Actually if you make it in LocalScript somewhere in StarterPlayerScripts or StarterCharacterScripts, shirt change will not replicate between other players, leading to that you will see other players wearing not desired shirt while you do.
You can do it by making Script in ServerScriptService and put something like this:
local Players = game:GetService("Players")
local ShirtId = "YourShirtIdHere"
Players.PlayerAdded:Connect(function(player: Player)
player.CharacterAdded:Connect(function(character: Model)
local shirt = character:FindFirstChildOfClass("Shirt")
if not shirt then
shirt = Instance.new("Shirt")
shirt.Parent = character
end
shirt.ShirtTemplate = ShirtId
end)
end)
2 Likes
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
