Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How Do I put hats on a player?

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

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.

3 comments

0

Um example? you need examples to learn math, you need examples to do chores etc....

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.

0

I got thanks though

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.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.