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

How to Equip an NPC with a sword?

Asked by
Aespect 25
8 years ago

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

2 answers

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
8 years ago

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).

0
Perfect, thanks. I was just missing the joint named "Right Shoulder". It was just named "Joint". Aespect 25 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

On the humanoiduse the :EquipTool(Tool) method.

0
It said it had to be connected to a Player for that to work. Aespect 25 — 8y
0
I guess you'll have to mabye weld the tool to the npcs hand? LifeInDevelopment 364 — 8y

Answer this question