im making a module that converts specialmeshes to meshparts for my game’s customization system. ive got everything working from property copying to children stealing. problem is, i can’t edit the meshpart’s id through script! it’s simply not accessible. how do i get by this?
im using this module to convert added hats into meshparts so they can have their materials changed. possible solutions could be some way to have the meshpart’s id already set when it’s created, or a way to bypass this whole system because of something i overlooked!
do not respond with something along the lines of “you cant convert a specialmesh to a meshpart.” kohl’s admin does it whenever you equip a hat through their commands, it is possible
thanks! help please! -princess
edit: if it’s not clear, im just replicating what kohl’s admin does when you add a hat with their commands. i need that behavior of converting the handle of a hat from a part with a specialmesh to a meshpart
About converting a FileMesh into MeshPart through a script, I’m afraid it is not possible:
The DataModelMesh/MeshId property of a SpecialMesh can be changed by a Script or LocalScript during runtime. The MeshPart.MeshId property of a MeshPart can not.
Also, I’ve tested it in studio and sadly, no, you can’t use the command bar to do so either. Right now, the only option is to set the MeshParts IDs manually in studio.
that’s… what im doing. the problem is that i cant edit the new meshpart’s id. unless you set the new meshpart’s id somewhere in that code and i missed it?
edit: really not appreciating how you just changed the entire message to be something else instead of just replying. also,
do not respond with something along the lines of “you cant convert a specialmesh to a meshpart.” kohl’s admin does it whenever you equip a hat through their commands, it is possible
Well that’s the way it is … I tried. I knew you could do this manually. I had no ideal you would be locked out at run time. The correct way to reply is: Thank you for your time. I’m pretty good at research. If I couldn’t find it, it’s most likely not possible… Good luck!
You can’t set MeshPart.MeshId through scripts, the only way to “set” MeshPart.MeshId is with AssetService:CreateMeshPartAsync(). There is no way around it.
Try
local mesh = Instance.new("MeshPart")
local newMeshId = "rbxassetid://1"
mesh:ApplyMesh(game.AssetService:CreateMeshPartAsync(newMeshId))