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

How to Equip an NPC with a sword?

Is there anyway to clone a sword from Lighting into an NPC? Thanks!

2 answers

✓ Accepted answer

All you have to do is parent the tool to the NPC and it should automatically equip the tool to the NPC's arm. Also I would not recommend parenting tools to Lighting, not because it doesn't work correctly but because there is a better alternative called ReplicatedStorage.

local tool = game.ReplicatedStorage.Tool
local NPC = game.Workspace.NPC

tool:Clone().Parent = NPC

Note that this only happens if the NPC has a Humanoid object and a Right Shoulder joint parented to a part of the NPC called Torso with Part0 equal to the torso and Part1 equal to the Right arm (Basically if it is a copy of a Roblox default character).

1 comment

0

Perfect, thanks. I was just missing the joint named "Right Shoulder". It was just named "Joint".

On the humanoid use the :EquipTool(Tool) method.

2 comments

0

It said it had to be connected to a Player for that to work.

0

I guess you'll have to mabye weld the tool to the npcs hand?

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