Migrating Heads and Accessories to be MeshParts

The only other hats with scripts that aren’t exclusive to admins are the sound hats, and they do not reference the SpecialMesh in the hat, so this update wouldn’t break those scripts. This would affect the Rbadam’s Smokestack specifically due to the fact that it references the SpecialMesh in the hat. However, this could easily be fixed with some simple if thens, so the hat can work with the new update and with the original SpecialMesh in a part.

--Script by Mah_Bucket

local now = os.date("*t")

local newmesh = "rbxassetid://2399307491" -- updated mesh for better texturing

local hw --= true
local tg --= true
local xm --= true
local bd --= true
local pt --= true
local vt --= true
local af --= true

if now.month == 10 and now.day > 21 then --Candy Day
	hw = true
elseif now.month == 11 and now.day > 19 then --Eating Too Much Day
	tg = true
elseif now.month == 12 and now.day > 17 and now.day < 28 then --Free Stuff Day
	xm = true
elseif now.month == 8 and now.day == 27 then --Roblox's Birthday!
	bd = true
elseif now.month == 3 and now.day > 11 and now.day < 20 then --Hunt Short Irishmen Day
	pt = true
elseif now.month == 2 and now.day > 8 and now.day < 17 then --Chocolate and Tears Day
	vt = true
elseif now.month == 4 and now.day == 1 then --April Fool's!
	af = true
end

local emitter = script.Parent:WaitForChild("ParticleEmitter") -- default smoke emitter
local burst = script.Parent:WaitForChild("Burst") -- bursting emitter
if script.Parent.ClassName=="Part" then
	mesh = script.Parent:WaitForChild("Mesh") -- the hat
else
	mesh = script.Parent -- the hat
end

-- holiday cheer
function snowBlower()
	local snow1 = script.Parent:WaitForChild("Snowflake1")
	local snow2 = script.Parent:WaitForChild("Snowflake2")
	while true do
		wait(math.random() * 5)
		snow1.Enabled = false
		snow2.Enabled = true
		wait(math.random() * 5)
		snow1.Enabled = true
		snow2.Enabled = false
		
		-- occasionally blow a ton of snow
		if math.random() > 0.97 then
			snow1.Enabled = false
			wait(4)
			snow1:Emit(22)
			wait(math.random())
			snow2:Emit(22)
			wait(2)
		end
	end
end

-- falliday cheer
function leafBlower()
	local leaf1 = script.Parent:WaitForChild("Leaf1")
	local leaf2 = script.Parent:WaitForChild("Leaf2")
	while true do
		wait(math.random() * 5)
		leaf1.Enabled = false
		leaf2.Enabled = true
		wait(math.random() * 5)
		leaf1.Enabled = true
		leaf2.Enabled = false
		
		-- occasionally blow a ton of leaves
		if math.random() > 0.97 then
			leaf1.Enabled = false
			wait(4)
			leaf1:Emit(22)
			wait(math.random())
			leaf2:Emit(22)
			wait(2)
		end
	end
end

-- irish pride
function cloverBlower()
	local leaf1 = script.Parent:WaitForChild("Clover1")
	local leaf2 = script.Parent:WaitForChild("Clover2")
	while true do
		wait(math.random() * 5)
		leaf1.Enabled = false
		leaf2.Enabled = true
		wait(math.random() * 5)
		leaf1.Enabled = true
		leaf2.Enabled = false
		
		-- occasionally blow a ton of clovers
		if math.random() > 0.97 then
			leaf1.Enabled = false
			wait(4)
			leaf1:Emit(22)
			wait(math.random())
			leaf2:Emit(22)
			wait(2)
		end
	end
end

-- check holidays
if hw then
	emitter.Enabled = false
	emitter = script.Parent:WaitForChild("Hallow") -- use this orange smoke
	if mesh:IsA("SpecialMesh") then mesh.TextureId = "rbxassetid://307022809" else mesh.TextureID = "rbxassetid://307022809" end -- halloween hat texture
elseif tg then
	if mesh:IsA("SpecialMesh") then mesh.TextureId = "rbxassetid://318670022" else mesh.TextureID = "rbxassetid://318670022" end -- thanksgiving hat texture
	spawn(leafBlower)
elseif xm then
	emitter.Enabled = false
	emitter = script.Parent:WaitForChild("Snowflake3") -- use this snow
	spawn(snowBlower)
elseif bd then
	emitter.Enabled = false
	emitter = script.Parent:WaitForChild("Confetti") -- confetti is the hip way to pollute
	if mesh:IsA("SpecialMesh") then mesh.MeshId = newmesh end
	if mesh:IsA("SpecialMesh") then mesh.TextureId = "rbxassetid://2399316028" else mesh.TextureID = "rbxassetid://2399316028" end -- birthday hat texture
	local age = Instance.new("Part") -- part showing Roblox's age
		age.CanCollide = false
		age.Transparency = 1
		age.TopSurface = 0
		age.BottomSurface = 0
		age.Size = Vector3.new(.6,.5,.1)
		age.CFrame = script.Parent.CFrame - Vector3.new(0,.175,.43)
		age.CustomPhysicalProperties = PhysicalProperties.new(0,.3,.5)
	local gui = Instance.new("SurfaceGui")
		gui.CanvasSize = Vector2.new(60,50)
		gui.LightInfluence = 1
	local text = Instance.new("TextLabel")
		text.BackgroundTransparency = 1
		text.Size = UDim2.new(1,0,1,0)
		text.TextScaled = true
		text.TextColor3 = Color3.fromRGB(210,45,32)
		text.Text = now.year - 2006 -- Roblox's age. What an old guy!
	local weld = Instance.new("WeldConstraint")
		weld.Part0 = script.Parent
		weld.Part1 = age
	age.Parent = script.Parent
	gui.Parent = age
	text.Parent = gui
	weld.Parent = script.Parent
elseif pt then
	if mesh:IsA("SpecialMesh") then mesh.MeshId = newmesh end
	if mesh:IsA("SpecialMesh") then mesh.TextureId = "rbxassetid://2399447918" else mesh.TextureID = "rbxassetid://2399447918" end -- pattie's hat texture
	spawn(cloverBlower)
elseif vt then
	emitter.Enabled = false
	emitter = script.Parent:WaitForChild("Heart") -- use this lovely smoke
	if mesh:IsA("SpecialMesh") then mesh.MeshId = newmesh end
	if mesh:IsA("SpecialMesh") then mesh.TextureId = "rbxassetid://2399448372" else mesh.TextureID = "rbxassetid://2399448372" end -- valentine hat texture
elseif af then
	emitter.Enabled = false
	emitter = script.Parent:WaitForChild("Hats") -- use this not smoke
	script.Parent.Smokescreen.Enabled = true
	script.Parent.Transparency = 1
end

-- turn emitter off and on periodically for more variation
while true do
	wait(0.6)
	emitter.Enabled = false
	wait(1.8)
	emitter.Enabled = true
	
	-- occasionally we like to burst some smoke for a different effect
	local rando = math.random()
	if rando > 0.97 then
		emitter.Enabled = false
		wait(4)
		burst.Enabled = true
		wait(2)
		burst.Enabled = false
		emitter.Enabled = true
	elseif rando > 0.969 then --very rare effect just to give people something to be excited about
		emitter.Enabled = false
		wait(4)
		for i,v in pairs(script.Parent:GetChildren()) do
			if v:IsA("ParticleEmitter") then
				v:Emit(math.random(6,10))
				wait(.5)
			end
		end
		wait(2)
		emitter.Enabled = true
	end
end

The only thing that must be added to fix the hat is another part in the hat to blow the smoke properly. Using a MeshPart for the hat makes the smoke come out of the entire hat rather than just the middle as it does currently. Also, MeshId cannot be edited with the script if the hat is a MeshPart, so some of the textures would look broken since they are on the wrong mesh. This just makes it stupidly complicated, as there would now have to be 2 MeshParts, one with the new mesh’s MeshId, and one with the standard one. One of them is visible depending on the event, for example, the birthday event uses the new mesh, and no event uses the standard mesh. This is the best solution I could think of.

4 Likes

This is a big update, I’m tired of particles surrounding the whole player head box rather than the circle. Thanks for this update.

3 Likes

I want to clarify few things though.

  1. There’s hats with scripts. This one for example uses SpecialMesh in it’s script to alter it’s own mesh.
    You might want to check some scripted hats, redo their scripts as well.
    Example: Rbadam's Smokestack Top Hat - Roblox

  2. There’s some hats with VertexColor. That means MeshParts require Color3 property.
    Example: Brainfreeze - Roblox

Wouldn’t it break those hats?

2 Likes

I believe attachment could fix the issue!
Just put particle inside of it. There might be no offset variety like for part though.

2 Likes

I’m excited for this change, this also means exploiters will in future, be unable to delete the meshes in their accessories which means plenty of exploits which do things like make blocks won’t work anymore.

1 Like

I did a fix to address this future change.
Was fun!

https://www.roblox.com/library/5646283851/Rbadams-Smokestack-Top-Hat-MeshPart-compatible

You’re right, an attachment would probably fix the issue there. As for the changing mesh issue, that would still require 2 meshparts, as you can’t change the MeshId of a meshpart in game for some reason still. And yes, we 100% need Color3 in meshparts, I have wanted this for so long.

2 Likes

Yeah, that’s why I did a hacky fix for said hat out of pure boredom.

1 Like

@CodeWriter Dev. reached out, Can you answer?

2 Likes

I noticed in this week’s update that characterR15V4.rbxm was added with a MeshPart head, but there seems to be an issue with the normal mapping seams around the face.

I’m sure this is known about, but I just wanted to post it here in case it was overlooked.

4 Likes

Is that R15V4.rbxm available to obtain it? also are these head on dummy models from the plugins will be changed to be a MeshParts?

This will be fixed once the new code is enabled.

4 Likes

What’s the update on the migration of MeshParts?

2 Likes

What’s also the update on the addition of texture coloring for meshparts? I feel like this is a needed addition considering Roblox is embracing meshparts more and more as time goes.

3 Likes

Any updates on issues that are causing the massive delay?

We’ve decided to ship MeshPart heads and accessories at the same time instead of as two separate releases. Should reduce complexity. Accessories took much longer because we had to convert the entire existing catalog of accessories (including UGC uploads).

8 Likes

This update seems to break acessories still using the deprecated ‘Hat’ instance

for example this: Ceremonial Guard of the Archduke of the Federation - Roblox now refuses to load in game

This feels like a weird setting to be put in Workspace’s properties. Feels like it should be in StarterPlayer properties or something, since it’s something that really only directly affects which type loads in when players join. Really nothing to do with the general game/workspace

It breaks this accessory, maybe because the SpecialMesh is called “SpecialMesh” not “Mesh”

Equipped transparent MeshParts seem to be causing Z-Index issues

Unequipped MeshPart on the right

Equipped MeshPart on the left

Found this issue thanks to @Mr_Purrsalot 's Rainbow Wings

Repro Place