Hello! The script I have is supposed to put a hat on the player but for some reason whenever I touch it, it teleports the player to the hairs position (The hair is in replicated storage) and the player gets stuck in that position. Does anyone know how to fix this? It is possible that the script is just outdated. Thanks in advance!

debounce = false



script.Parent.Touched:connect(function(Hit)
	if Hit.Parent:FindFirstChild("Humanoid") then -- I use FIndFirstChild() to prevent Errors
		wait(0.5)
		if debounce == false then debounce = true
			local Copy = game.ReplicatedStorage:FindFirstChild("Hair1"):Clone()
			local Char = Hit.Parent -- This is the Character(Model that holds all parts)
			local player = game.Players:GetPlayerFromCharacter(Char) -- So we know WHO to give the Hat
			Copy.Parent = player.Character
			wait(3)
			debounce = false
		end
	end
end)

2 comments

0

unanchored hair1

0

This is because the hat is anchored make sure the hat isnt anchored