Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change a characters package during run time? [ANSWERED]

Asked by 6 years ago
Edited 6 years ago

I've asked this question yesterday but to no avail there was no answers given to me so im going to post this question again with hopes of finding an answer.

Code sample:

ORIGINAL_RightUpperLeg.MeshId = RightUpperLeg.MeshId
ORIGINAL_RightUpperLeg.TextureID = RightUpperLeg.TextureID
ORIGINAL_RightUpperLeg.Size = RightUpperLeg.Size

i have tried to change the players mesh id and texture id but it comes with an error.

Error: Unable to assign property MeshId. Script write access is restricted

Is there any other method in doing this as it seems you cant just simply change the mesh ID. E.g. I am thinking of making the original package be transparent and add the new package into the player so its like thats the package they equipped now.Any thoughts? plus how would i weld it to the character

OR

Im also thinking in making my own custom character but this time it uses special meshes. As special meshes you can actually change the mesh ID. but i dont know if this is the best method. Any thoughts?

I dont want the player to equip the whole package only a part of it .E.g the torso

2 answers

Log in to vote
1
Answered by 6 years ago

Instead of using MeshPart you have to - I repeat - Have To use SpecialMesh.

Try it and see what you get. The properties work the same way.

https://www.robloxdev.com/api-reference/class/SpecialMesh

There's a wiki page

0
So you think i should create a custom character but made with special meshes instead of mesh parts? LordOfWatermelons 27 — 6y
0
Yes, SpecialMeshes can also be created with File contents (Custom Meshes) to create your Custom Characters. xxcoordinatorxx 135 — 6y
0
I concur ABK2017 406 — 6y
Ad
Log in to vote
1
Answered by
ABK2017 406 Moderation Voter
6 years ago

-Dev-

The last line is especially important.

Meshes can currently only be be uploaded using MeshParts or the game explorer. Once uploaded however, the content ID for the mesh can be used for the MeshId property. For more information on how to do this please see this tutorial. Note currently this property cannot be changed by scripts as the collision model of the mesh cannot be recomputed during run-time. Developers should not rely on this behavior as it is possible it may change in the future. Those looking for a custom mesh object that can be updated during runtime should use SpecialMesh.

0
-_- xxcoordinatorxx 135 — 6y
0
i can only award 1 person the answer but ive upvoted yours LordOfWatermelons 27 — 6y
0
No worries, he beat me by 4 minutes :P ABK2017 406 — 6y

Answer this question