Okay, so I have a localscript inside a tool named Knife. Its primary function currently is to create the arms for the tool and then weld them. Here is my problem, the script clones the left arm but it looks nothing like what the characters left arm actually looks like. How do you get the players actual arm apparent? There has to be a way I just don't know how I would do it.
Here is the code(feel free to point out stuff I should change, having separate functions will be important in the future though so don't ask):
repeat wait() until game.Players.LocalPlayer -------------------------------------------------------------- --Global Variables: -------------------------------------------------------------- player = game.Players.LocalPlayer c = player.Character tool = script.Parent debounce = false -------------------------------------------------------------- --Creating the arms function -------------------------------------------------------------- function makearmleft(armtype) if armtype == "left" then leftarm = script.Parent.Parent["Left Arm"]:Clone() leftarm.Parent = script.Parent print("the end") elseif armtype == "right" then print("RIGHT") end end -------------------------------------------------------------- --Welding the arms function -------------------------------------------------------------- function weldarm(armtype) if armtype == "left" then local w1 = Instance.new("Weld", c) w1.Part0 = w1.Parent["Left Arm"] -- the item, This is your wall w1.Part1 = leftarm -- the item you want to weld to part0, this is your poster w1.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) *CFrame.new(0, 0, 0) -- the cframe from the EulerAngles, first one changes the main angles, second is kinda like an offset elseif armtype == "right" then print("right arm") end end -------------------------------------------------------------- --User Controls -------------------------------------------------------------- function equippedtool() if debounce == false then debounce = true print("Equipped") makearmleft("left") weldarm("left") print("MADE IT") debounce = false end end function unequippedtool() leftarm:Destroy() --add rightarm end tool.Unequipped:connect(unequippedtool) tool.Equipped:connect(equippedtool)
You're cloning the arm, but characters also have an object inserted into their Models called a CharacterMesh
. This object modifies the appearance of the arm; without it, the arm is simply a block.
Unfortunately, this object only works inside a character. To make it work inside a regular brick, you must insert a SpecialMesh
into the brick, then set the SpecialMesh's MeshId
property to the CharacterMesh's MeshId property.
Note that the MeshId property for CharacterMeshes is just a number, while for SpecialMeshes it must be rbxassetid://
with a number.
mesh.MeshId = "rbxassetid://"..characterMesh.MeshId
I don't know if you know but if your arm is not the default ROBLOX arm (the block arm) then in your character you have something not sure what it was called I thinking was ....texture. I'm on my phone right now so can't really tell but that's basically what makes the arm different. Hope I helped.