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

Why my hat Position wont change?

Hi, i want to make a hat that is above my head and when i run my script, the hat is inside my head idk why, heres the script

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local part = Instance.new("Part")
		part.Parent = character.Head
		part.Position = Vector3.new(0,5,0) --heres the problem
		part.Name = "Wat"
		
		local weld = Instance.new("Weld")
		weld.Parent = part
		weld.Part0 = character.Head.Wat
		weld.Part1 = character.Head
	end)
end)

2 answers

Maybe try setting the C0 value of the weld i think idk

weld.C0 = CFrame.new(0, 1, 0)

Will push it up 1 stud i think

Hello. Try using a WeldConstraint instead of a Weld.

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local part = Instance.new("Part")
        part.Parent = character.Head
        part.Position = Vector3.new(0,5,0) --heres the problem
        part.Name = "Wat"

        local weld = Instance.new("WeldConstraint")
        weld.Parent = part
        weld.Part0 = character.Head.Wat
        weld.Part1 = character.Head
    end)
end)

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