Attachment not Parenting to Player's Head [HELP FAST]

Iam making a shooter game and im making the Zoom system. I made this little script in SSS and it just doesnt parent the attachment to the players head…

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		print("e")
		local ATT = Instance.new("Attachment")
		ATT.Parent = script.PlaceHolder
		ATT.Name = 'ZOOMEDGUN'
		ATT.Position = Vector3.new(0,-2,5)
		------
		ATT:Clone().Parent = char:WaitForChild("Head")
	end)
end)

ASK ME FOR ANYTHING BUT PLEASE BE FAST!!

You are cloning the attachment after setting its parent to the placeholder. This means that the cloned attachment will inherit the parent of the original one, which is not what you want. You want to clone the attachment before setting its parent, so that the cloned one can have a different parent.

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        print("e")
        local ATT = Instance.new("Attachment")
        ATT.Name = 'ZOOMEDGUN'
        ATT.Position = Vector3.new(0,-2,5)
        ------ 
        local clonedATT = ATT:Clone()
        clonedATT.Parent = char:WaitForChild("Head")
        ATT.Parent = script.PlaceHolder
    end)
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.