This is already fixed Roblox changed the ClassName from hat to Accessory

**So this is the script i have:

local Morpher = script.Parent

function onTouch(Brick)
	for item, child in pairs(Brick.Parent:GetChildren()) do
		if child.ClassName == "Hat" then
			child.Name = "Cap"
			
			child.Handle.Mesh.MeshId = 
			"https://www.roblox.com/asset/?id=16190466"
			
			child.Handle.Mesh.TextureId =
			"https://www.roblox.com/asset/?id=51278992"
		end
	end
end

Morpher.Touched:connect(onTouch)

Im learning with an Scripting book, but this script doesn't seem to work. I get no errors for some reason... Is this maybe old code? I dont know.**

1 comment

0

Fixed! Roblox changed the ClassName to Accessory..