SHOW:
|
|
- or go back to the newest paste.
1 | local Humanoid = Instance.new("Model", game.Workspace) | |
2 | - | Humanoid.Name = "This is a test humanoid" |
2 | + | |
3 | HumanoidRootPart = Instance.new("Part", Humanoid) | |
4 | - | Torso.RootPriority = -127 |
4 | + | HumanoidRootPart.Transparency = 1 |
5 | - | Hum = Instance.new("Humanoid", Humanoid) |
5 | + | Hum = Instance.new("Humanoid", HumanoidRootPart) |
6 | - | Hum.Name = "woahaperson" |
6 | + | |
7 | Torso.Size = Vector3.new(2,2,1) | |
8 | RightArm = Instance.new("Part", Humanoid) | |
9 | - | Torso.Name = "Torso" |
9 | + | |
10 | RightArm1 = Instance.new("Motor6D") | |
11 | RightArm1.Parent = Torso | |
12 | - | RightArm.RootPriority = -127 |
12 | + | |
13 | - | RightArm.Name = "Right Arm" |
13 | + | |
14 | LeftArm = Instance.new("Part", Humanoid) | |
15 | LeftArm.Size = Vector3.new(1,2,1) | |
16 | LeftArm1 = Instance.new("Motor6D") | |
17 | LeftArm1.Parent = Torso | |
18 | - | RightArm1.Name = "Right Shoulder" |
18 | + | |
19 | LeftArm1.Part1 = LeftArm | |
20 | LeftLeg = Instance.new("Part", Humanoid) | |
21 | - | LeftArm.RootPriority = -127 |
21 | + | |
22 | - | LeftArm.Name = "Left Arm" |
22 | + | |
23 | LeftLeg1.Parent = Torso | |
24 | LeftLeg1.Part0 = Torso | |
25 | LeftLeg1.Part1 = LeftLeg | |
26 | RightLeg = Instance.new("Part", Humanoid) | |
27 | - | LeftArm1.Name = "Left Shoulder" |
27 | + | |
28 | RightLeg1 = Instance.new("Motor6D") | |
29 | RightLeg1.Parent = Torso | |
30 | - | LeftLeg.RootPriority = -127 |
30 | + | |
31 | - | LeftLeg.Name = "Left Leg" |
31 | + | |
32 | Head = Instance.new("Part", Humanoid) | |
33 | Head.Size = Vector3.new(1,1,1) | |
34 | Neck = Instance.new("Motor6D") | |
35 | Neck.Parent = Torso | |
36 | - | LeftLeg1.Name = "Left Hip" |
36 | + | Neck.Part0 = Torso |
37 | Neck.Part1 = Head | |
38 | RightLeg.Position = Vector3.new(0.5,0,0) | |
39 | - | RightLeg.RootPriority = -127 |
39 | + | LeftLeg.Position = Vector3.new(-0.5,0,0) |
40 | - | RightLeg.Name = "Right Leg" |
40 | + | Torso.Position = Vector3.new(0,2,0) |
41 | HumanoidRootPart.Position = Vector3.new(0,2,0) | |
42 | Head.Position = Vector3.new(0,3.5,0) | |
43 | RightArm.Position = Vector3.new(1.5,2,0) | |
44 | LeftArm.Position = Vector3.new(-1.5,2,0) | |
45 | - | RightLeg1.Name = "Right Hip" |
45 | + | HumanoidRootPart1 = Instance.new("Weld") |
46 | HumanoidRootPart1.Parent = HumanoidRootPart | |
47 | HumanoidRootPart1.Part0 = HumanoidRootPart | |
48 | - | Head.RootPriority = -127 |
48 | + | HumanoidRootPart1.Part1 = Torso |
49 | - | Head.Name = "Head" |
49 | + | HumanoidRootPart1.part1 = Torso |
50 | - | Necklol = Instance.new("Motor6D") |
50 | + | HumanoidRootPart.Name = "HumanoidRootPart" |
51 | - | Necklol.Parent = Torso |
51 | + | Humanoid.PrimaryPart = owner.Character.HumanoidRootPart |
52 | - | Necklol.Part0 = Torso |
52 | + | part1 = HumanoidRootPart |
53 | - | Necklol.Part1 = Head |
53 | + | local bg = Instance.new("BodyGyro",part1) |
54 | - | Necklol.Name = "Neck" |
54 | + | bg.D = 100 |
55 | - | rootPart = Instance.new("Part", Humanoid) |
55 | + | bg.P = 100000 |
56 | - | rootPart.Name = "HumanoidRootPart" |
56 | + | bg.MaxTorque = Vector3.new(1000000,1000000,1000000) |
57 | - | rootPart.Size = Vector3.new(2,2,1) |
57 | + | local velocitylol = Instance.new("BodyVelocity", part1) |
58 | - | rootPart.Transparency = 1 |
58 | + | coroutine.wrap(function() |
59 | - | rootPart.RootPriority = 127 |
59 | + | while true do |
60 | - | Root = Instance.new("Motor6D") |
60 | + | task.wait() |
61 | - | Root.Parent = rootPart |
61 | + | velocitylol.MaxForce = Vector3.new(math.huge,math.huge,math.huge) |
62 | - | Root.Part0 = rootPart |
62 | + | velocitylol.Velocity = part1.CFrame.LookVector * -32 |
63 | - | Root.Part1 = Torso |
63 | + | end |
64 | - | Root.Name = "Root Hip" |
64 | + | end)() |
65 | - | RightLeg1.C1 = RightLeg1.C1 * CFrame.new(0.5,2,0) |
65 | + | function move(target) |
66 | - | LeftLeg1.C1 = LeftLeg1.C1 * CFrame.new(-0.5,2,0) |
66 | + | local dir = (part1.Position - target.Position).unit |
67 | - | Necklol.C1 = Necklol.C1 * CFrame.new(0,-1.5,0) |
67 | + | local spawnPos = part1.Position |
68 | - | RightArm1.C1 = RightArm1.C1 * CFrame.new(1.5,0,0) |
68 | + | local pos = spawnPos + (dir * 1) |
69 | - | LeftArm1.C1 = LeftArm1.C1 * CFrame.new(-1.5,0,0) |
69 | + | bg.cframe = CFrame.new(pos, pos + dir) |
70 | - | rootPart.CanCollide = false |
70 | + | end |
71 | - | LeftArm.CanCollide = false |
71 | + | |
72 | - | RightArm.CanCollide = false |
72 | + | function findNearestTorso(pos) |
73 | - | wait(0.1) |
73 | + | local list = game.Workspace:GetChildren() |
74 | - | rootPart.CFrame = CFrame.new(5,5,5) |
74 | + | local torso = nil |
75 | - | Hum.WalkSpeed = 16 |
75 | + | local dist = 1000 |
76 | - | Hum.JumpPower = 40 |
76 | + | local temp = nil |
77 | - | NLS([[ |
77 | + | local human = nil |
78 | - | local animate = owner.Character.Animate:Clone() |
78 | + | local temp2 = nil |
79 | - | wait(0.125) |
79 | + | for x = 1, #list do |
80 | - | Humanoid = game.Workspace:WaitForChild("modelpersonlol") |
80 | + | temp2 = list[x] |
81 | - | Hum = Humanoid:WaitForChild("woahaperson") |
81 | + | if (temp2.className == "Model") and (temp2 ~= script.Parent) then |
82 | - | owner.Character = Humanoid |
82 | + | temp = temp2:findFirstChild("Head") |
83 | - | workspace.CurrentCamera.CameraSubject = Hum |
83 | + | human = temp2:findFirstChild("Humanoid") |
84 | - | Hum.WalkSpeed = 16 |
84 | + | if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then |
85 | - | Hum.JumpPower = 40 |
85 | + | if (temp.Position - pos).magnitude < dist then |
86 | torso = temp | |
87 | - | animate.Parent = Humanoid |
87 | + | dist = (temp.Position - pos).magnitude |
88 | - | ]],owner.PlayerGui) |
88 | + | end |
89 | end | |
90 | end | |
91 | end | |
92 | return torso | |
93 | end | |
94 | while true do | |
95 | local torso = findNearestTorso(part1.Position) | |
96 | if torso~=nil then | |
97 | move(torso) | |
98 | end | |
99 | task.wait() | |
100 | end |