|
| 31 Dec 2012 11:07 PM |
Im trying to put a Character Mesh into a player, I have to MeshIds in the top Table and the Bodyparts they go with in the bottom.
local charMeshes ={27111419,27111857,27111864,27111882,27111894} local bodyParts = {"LeftArm","LeftLeg","RightArm","RightLeg","Torso"} for z = 1,6 do local bodyMesh = Instance.new("CharacterMesh") bodyMesh.Parent = v.Character bodyMesh.MeshId = charMeshes[z] bodyMesh.BodyPart = bodyParts[z] end
It keeps saying for the BodyPart = bodyParts[z] it is an Invalid Enum.. Help? |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2012 11:20 PM |
| bodyMesh.BodyPart = Enum.BodyPart[bodyParts[z]] |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2012 11:44 PM |
| It says String expected, Got nil |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2012 11:47 PM |
| Oh, yeah... your loop goes up to 6, not 5... forgot to mention that. Change for "z = 1,6 do" to "for z = 1,5 do" |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2013 02:04 AM |
to be safe you could do
for z = 1, #charMeshes |
|
|
| Report Abuse |
|
|