I’m trying to convert around 50 hats into just simple mesh parts in studio, obviously this would be painful and boring to do it by hand, so I wrote some code to make it easier. This is the code which is ready to be pasted into the command bar
local Position = CFrame.new(38, 4.5, 242);
for i, v in pairs(workspace.Folder:GetChildren()) do
local MeshPart = Instance.new("MeshPart");
local MeshId = v.Handle.Mesh.MeshId;
local TextureId = v.Handle.Mesh.TextureId;
v:Destroy();
MeshPart.MeshId = MeshId;
MeshPart.TextureID = TextureId;
MeshPart.CFrame = Position;
Position = Position * CFrame.new(0,0,-5);
MeshPart.Parent = workspace.Hats;
end
The only problem is, when I go to run it I get this error
06:18:42.912 - Unable to assign property MeshId. Script write access is restricted
Is there any way to get around this? I originally thought you were able to write to the MeshId of the MeshPart as long as it was only in Studio?
Yes, unfortunately, Roblox hasn’t enabled scripts to be able to change MeshId’s that could be a good feature suggestion. However, all hats have a part named handle, which is generally a mesh part or part with a mesh in it. You can extract that from the hats with similar code.
Mainly just want them to be MeshParts for personal preference and easier to move but thanks anyway. I’d make a feature suggestion if I was a full member
Thanks for the solution, if you post what you would want to post in the suggestion thread in #bulletin-board, then message the Lead_top_Contributor group, they will review it and likely move it to the appropriate location for you.
I think this is worth bumping up very much. Currently I am having the same issue, except its a little different. I am trying to make a game that needs a lot of symmetry and I’m using a lot of meshparts. In order for the symmetry, I use a mirror script in order to mirror all my parts. I run that script and it works perfectly except for meshparts. There is however a solution I really like to this problem. I simply uploaded mirror versions of all my meshparts and stick them all in a dictionary so that if this meshpart has this mesh id, then switch the mesh id to the mirrored one. Simple! If you don’t think this works it does because if I manually change the parts meshid to the mirrored one, it’s perfect. However it takes forever to do that but the script doesn’t give me write access to change the meshid. It takes super long to do this.
I am making maps constantly. Its not like a 1 map game. Its a game that gets updated frequently with new maps so its not like I am only doing this once. I’m doing this countless times, nonstop. And it literally takes forever.
This is still an issue, and it means that we have to manually re-paste the mesh ID every time we’re converting SpecialMeshes to MeshParts. If there is an issue with this property being edited during run-time, then it should be disabled during run-time, however in studio I see no reason to not allow this functionality, at least from the command bar.
Is there any way at all to get around this limitation?
(I know this post is 6 months old, I didn’t want to create a new post when this already exists)