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

What is wrong with my Script?

This script is supposed to change the Characters Mesh to Different Mesh Ids, But It only works via the Torso... Tell me why?

while true do
    for _, plr in pairs(game.Players:GetPlayers())do
        plr.Character.Head.Mesh.MeshId = "http://www.roblox.com/asset/?id=19999257"
        plr.Character.Head.Mesh.TextureId = "http://www.roblox.com/asset/?id=20001023"
        plr.Character.Head.Transparency = "0"
        plr.Character.Head.face.Texture = "0"
      c = Instance.new("CharacterMesh") 
      c.Parent = plr.Character
      c.Name = "hj"
      c.MeshId = "27111894"
      c.BodyPart = "Torso"
      c:Clone().Parent = plr.Character
      wait()
      c.Name = "yo" 
      x.BodyPart = "Left Arm"
      c.MeshId = "64022346"
         wait()
     c:Clone().Parent = plr.Character
	  c.Name = "Lfg"
      c.BodyPart = "Left Leg"
      c.MeshId = "64022355"
        wait()
    c:Clone().Parent = plr.Character 
     c.Name = "Rig"
     c.BodyPart = "Right Arm"
     c.MeshId = "27111894"
      wait()
  c:Clone().Parent = plr.Character
    c.Name = "fg"
    c.BodyPart = "Right Leg"
    c.MeshId = "64022355"
    end
    wait() 
end                  
   

2 answers

It seems you might have had a typo on line 15, x to me seems like a nil value which would error out the script. You've been using c the whole time with all of your meshes, so use c on line 15.

while true do
    for _, plr in pairs(game.Players:GetPlayers())do
        plr.Character.Head.Mesh.MeshId = "http://www.roblox.com/asset/?id=19999257"
        plr.Character.Head.Mesh.TextureId = "http://www.roblox.com/asset/?id=20001023"
        plr.Character.Head.Transparency = "0"
        plr.Character.Head.face.Texture = "0"
      c = Instance.new("CharacterMesh") 
      c.Parent = plr.Character
      c.Name = "hj"
      c.MeshId = "27111894"
      c.BodyPart = "Torso"
      c:Clone().Parent = plr.Character
      wait()
      c.Name = "yo" 
      c.BodyPart = "Left Arm"
      c.MeshId = "64022346"
         wait()
     c:Clone().Parent = plr.Character
      c.Name = "Lfg"
      c.BodyPart = "Left Leg"
      c.MeshId = "64022355"
        wait()
    c:Clone().Parent = plr.Character 
     c.Name = "Rig"
     c.BodyPart = "Right Arm"
     c.MeshId = "27111894"
      wait()
  c:Clone().Parent = plr.Character
    c.Name = "fg"
    c.BodyPart = "Right Leg"
    c.MeshId = "64022355"
    end
    wait() 
end                  

1 comment

0

But I have to define it otherwise there would be an error because it doesnt know what its parent is.

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