Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- anchor the NPC before using this
- -- delete the Humanoid that is in the model too
- local model = script['Parent'];
- local torso = model.Torso
- local head = model['Head']
- for i,v in pairs(model:GetChildren()) do
- if v ~= torso and v:IsA([==[BasePart]==]) then
- local w = Instance.new([==[Weld]==], game.JointsService);
- w.C1 = v.CFrame:toObjectSpace(torso.CFrame);
- w.Part0 = torso
- w.Part1 = v
- end
- end
- local human = Instance.new("Humanoid")
- human.MaxHealth = 100
- human.Health = 100
- human.WalkSpeed = 16
- for i,v in pairs(model:GetChildren()) do
- if v:IsA("BasePart") then
- v.Anchored = not true;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement