Ok. So. There are a few errors. Your parenting it to the PLAYER. Not the character
You're not setting the position of the hat. So it will either be really far away or it will be INSIDE of your head.
You parenting it to game.Players??
This is the script you wanna use
local button = script.Parent
button.MouseButton1Up:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
local hat = game.ReplicatedStorage.BlackTacticalHeadphones:Clone()
hat.Parent = character:FindFirstChild("Head"):FindFirstChild("HatAttachment")
end
end)
Tell me if that works. I didnt write it in studio
Also make sure you have the BlackTacticalHeadphones in your ReplicatedStorage
3 comments
Where is this script in and is it a serverscript or a localscript
its in the button. Its a local script
if its a local script then that might be your problem, if something is affecting the server such as creating a new instance or cloning something then that would be used with a script not a local one, so you would have to put a remote event on the local script to make a item