Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there any way to get the meshId of the character and set it to the meshId of a dummy?

in the output, there's an error saying: "Unable to assign property MeshId. Script write access is restricted"

How do I assign the meshId of the dummy to the one on the character? Please help me.

1 answer

Assuming you mean copying the packages of the character on to the dummy, you would do something like this in a server script. Keep in mind you have to set the character and dummy variables to make it work:

local character = --set to player character
local dummy = --set to dummy model
for _,v in pairs(character:GetChildren()) do
   if v:IsA("CharacterMesh") then
      local c = v:Clone()
      c.Parent = dummy
   end
end

This should automatically copy the CharacterMeshes from the player into the dummy.

Otherwise, if you just wanted to only translate the MeshId across, you could do something like

dummyMesh.MeshId = characterMesh.MeshId

where the variables of dummyMesh and characterMesh would be the CharacterMeshes of the character and dummy.

11 comments

0

I want to do the second thing, but when I do it makes that error in the output.

0

What exactly are you doing this for and what context are you doing it in? Is it only transferring specific MeshIds? Does it occur when the player touches something?

0

it occurs when the player clicks a button, it's supposed to make a dummy look exactly like the character. It's not supposed to be FE by the way.

0

In that case you should be able to clone the player's character and replace the dummy with the clone.

0

I've tried that but it doesn't work (when it's in a mousebutton1down function) :/

0

I put it in a localscript maybe that is why.

0

Oh I just remebered, you have to set the Archivable property of the character to true before you can clone it.

0

I've tried to put it in a script but you can't use mousebutton functions in the script. So I think I cannot clone the character

0

You can use RemoteEvents to send a message to the server when the MouseButton1Down event occurs on the client. However, if your game is not FE then you should be able to do it entirely with a LocalScript

0

The thing is I don't want to use remote events in it, my game is FE but I want it so only the client sees it, and it doesn't affect the other players. So I don't want it to be FE.

0

I've made a full FE avatar editor and I have a fear that it may cause too much lag, here is the link if you want to see it: https://www.roblox.com/games/1207279914/Avatar-Editor-Tester , the thing is I feel like making one that is FE is a bad idea I should just make it all not FE and then when the player presses done it will fire a remote event that will clone everything and put it inside the char

This discussion is preserved as it was. New answers, comments, and votes are closed.