script.Parent.MouseButton1Down:connect(function()
playername = script.Parent.Parent.Parent.Parent.Name
player = Workspace:FindFirstChild(""..playername.."")
if player ~= nil then
player:FindFirstChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=14729308"
end
end)
I'm a beginner scripter, so it took me forever just to make this script for shirts, but I can't figure out ow to convert this to hats. Please help.

2 comments
didn't work after I tried it
That's weird... when I debugged it in studio with 'player=workspace.Player1'' it worked....