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

How Do I put hats on a player?

Asked by 9 years ago

I added a script in my backpack that removes hats now I'm curious how to add hats WITHOUT welding I want this to be as smooth as possible here is my hat remover script

    for i, v in pairs(player.Character:GetChildren()) do
            if v:IsA("Hat") then
                v:remove()  
        end
    end

3 answers

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Well, since you haven't shown an attempt to ADD the hat, I'll only give advice. You could insert the hat via the InsertService, then parent it to the player. It'll auto weld/place itself.

0
Um example? you need examples to learn math, you need examples to do chores etc.... Clakker200 5 — 9y
0
Giving players hats from the InsertService is not the only way to do so. You can also store it in ServerStorage or something like that. Redbullusa 1580 — 9y
0
I got thanks though Clakker200 5 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Use Instance.new to make a hat. Put in a part and a SpecialMesh inside of that with the mesh type set to FileMesh, and set that to the mesh of that hat you want the player to have. Or something like that. Or, you could do what the above answer says, and use InsertService.

Log in to vote
0
Answered by
RoyMer 301 Moderation Voter
9 years ago

Or...put a hat somewhere and clone it into the character

If it is a local script: otherwise up to you

local player = game.Players.LocalPlayer
local hat = game.Lighting.Hat:Clone()
hat.Parent=player.Character

Answer this question