Hat not being placed properly

Here is the video of my problem:

I tried cloning the banana bod to the character but it would just spawn on top of the players head.

Here is my script:

local plr = game.Players:GetPlayerFromCharacter(script.Parent)
local infected = script.Parent.Infected;
local character = script.Parent;
local player = game.Players.LocalPlayer;
local Humanoid = script.Parent:FindFirstChild("Humanoid")
plr.TeamColor = game.Teams.Human.TeamColor
function cover(part,x,y,z,mesh) 
	local Goo = game.Lighting.Goo:Clone()	
	Goo.Parent = part.Parent 
	Goo.Size = part.Size 
	Goo.Color = script.Color.Value 

	Goo.Mesh.MeshType = Enum.MeshType.FileMesh 
	Goo.Mesh.MeshId = mesh 
	Goo.Mesh.Scale = Vector3.new(part.Size.X,0,part.Size.Z) 

	local weld = Instance.new("Weld",part)	
	weld.Part0 = part 
	weld.Part1 = Goo


	game:GetService("TweenService"):Create(Goo.Mesh, TweenInfo.new(0.75,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut), 
	{Scale = Vector3.new(x,y,z),Offset = Vector3.new(0,0,0)}):Play()

	Goo.Noise:Play()
end
function HatGive(instance) 
	for e = 1, #instance, 1 do
		plr:LoadCharacterAppearance(instance[e])
	end
end

infected.Changed:Connect(function()
	Humanoid:LoadAnimation(script.Sleep):Play();
	plr.TeamColor = game.Teams.Infected.TeamColor
	local old_walkspeed = Humanoid.WalkSpeed;	
	local old_jump = Humanoid.JumpPower	
	Humanoid.WalkSpeed = 0;
	Humanoid.JumpPower = 0;
	--Cover script
	cover(script.Parent["Left Arm"],1.05, 1.05, 1.05, "rbxassetid://430080282")
	wait(0.667)
	cover(script.Parent["Right Arm"],1.05, 1.05, 1.05, "rbxassetid://430080282")
	wait(1)
	cover(script.Parent["Torso"],2.05, 1.05, 1.05, "rbxassetid://430080282")
	wait(2.267)
	cover(script.Parent["Left Leg"],1.05, 1.05, 1.05, "rbxassetid://430080282")
	wait(1)
	cover(script.Parent["Right Leg"],1.05, 1.05, 1.05, "rbxassetid://430080282")

	for _, accessory in pairs(script.Parent.Humanoid:GetAccessories()) do 
		accessory:Destroy();
	end
	local array_holder = {game.Lighting.BananaBod:Clone(), game.Lighting.MonkeyHat:Clone();}
	HatGive(array_holder)
	local grab = game.Lighting.Grab;
	local copy = grab:Clone()
	copy.Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack
	local trans = game.Lighting.Transfur;
	local copy = trans:Clone()
	copy.Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack
	script.Parent.Head.Color = script.Color.Value;
	wait(2.5)
	script.Revive:Play();
	
	Humanoid.WalkSpeed = old_walkspeed;
	Humanoid.JumpPower = old_jump;
end)

Simply try changing the offset on the SpecialMesh part inside of the hat with the script. The offset Y should be lowered.

I suggest lowering the Y offset until you reach the proper direction for the suit.

I just suggested that, silly. :rofl:

E, guess you beat me to the typing challenge eh?

Mwahahahah. Good game, sir. o7

Can you tell me where I can change the offset? Sorry for asking, I’m kinda new to scripting so I don’t know a lot.

hat.Handle.SpecialMesh.Offset = Vector3.new(0,-2,0)

	for _, accessory in pairs(script.Parent.Humanoid:GetAccessories()) do 
		accessory:Destroy();
	end
	local BananaBod = game.Lighting.BananaBod
	local array_holder = {game.Lighting.BananaBod:Clone(), game.Lighting.MonkeyHat:Clone();}
	HatGive(array_holder)
	local grab = game.Lighting.Grab;
	local copy = grab:Clone()
	copy.Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack
	local trans = game.Lighting.Transfur;
	local copy = trans:Clone()
	copy.Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack
	script.Parent.Head.Color = script.Color.Value;
	BananaBod.Handle.SpecialMesh.OffSet = Vector3.new(0,-2,0)

I tried this but it didn’t work

Unless I did it in the wrong place.

Where is there a collin here? xD. Also, what do error logs say? (press f9 to see them)

THis is the error message

Lowercase S. Do that then I have solved your woes!

Let me know if it works please! <3 I’ve only solved one dev forum thing and it was my own problem. :flushed:

It sadly did not work. Maybe it’s just that the offset is too low. I’ll keep trying using your way.

What does the error say? Did you change OffSet to Offset?

There is a property on attachments called AttachmentPos. You can change this in a script or manually. Try using

BananaBod.AttachmentPos = Vector3.new(0, 1, 0)

There is no error. Now I am confused lol.

Play with the values in explorer in test mode then when you find the one you like, manually set it in the script.

The test dummy was the problem… I removed it as StarterCharacter and just wore a different avatar. Turns out that it actually works and the dummy was being, well… a dummy.