Well i am asking this because i will use it for a military group but the tutorials i only saw are about uniforms. The hat i will use has a few meshparts and parts.
COMMUNITY QUESTION
How to have hats on player joined?
1 answer
Ok first of all you have to have the hat in your game, so let’s say you have it in your replicated storage for now. So put your hat in the service replicated service, and put the following code in ServerScriptService
local HatName = “Hat” — Name of the hat
Local Hat = game.ReplicatedStorage:WaitForChild(HatName) — The hat
game.Players.PlayerAdded:Connect(function(Player) — Player event
Player.CharacterAdded:Connect(function() — Character Event
local char = workspace:WaitForChild(Player.Name)
local Clone = Hat:Clone() — Clones the hat
Clone.Parent = char
end)
end)
Lemme know if this works! MAKE SURE that you put the hat in Replicated Storage and put the EXACT name of the hat in the HatName variable. This code will give the player the hat whenever the player joins, when they die, etc.
1 comment
0
This cod,
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
when a player joins parent the hat to the player