Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't this player entered hat giver work?

Asked by 9 years ago

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.

1 answer

Log in to vote
0
Answered by 9 years ago

Try putting the hat inside the character not the head.

hat.Parent = Plyr.Character
Ad

Answer this question