I've been trying to figure out how to give a hat located in the Workspace to each player when they join the server. I need the players current hats removed, and then this hat given to them. So far, the player looks like a noob when they join, but they don't get the hat. Any help would be awesome.
Join = (function (Plyr)
Plyr.CanLoadCharacterAppearance = false
wait(1)
local hat = game.Workspace.MorningGlasses:Clone()
if not Plyr.Character then
Plyr.CharacterAdded:wait()
end
hat.Parent = Plyr.Character.Head
end)
wait(1)
game.Players.PlayerAdded:connect(Join)
for _,v in next, game.Players:GetPlayers() do
Join(v)
end
The code above is what I've been working with. It's inside a script in ServerScriptService.
