SHOW:
|
|
- or go back to the newest paste.
1 | local oldtick = tick() | |
2 | warn("Animation rig - By Mewy23") | |
3 | local plr = game:GetService("Players").LocalPlayer | |
4 | local char, mouse = plr.Character, plr:GetMouse() | |
5 | local hitTab = {} | |
6 | local fadeTab = {} | |
7 | local spd = 0.2 * char:FindFirstChild("Humanoid").WalkSpeed / 16 | |
8 | local sound1 = Instance.new("Sound", char.HumanoidRootPart) | |
9 | local sound2 = Instance.new("Sound", char.HumanoidRootPart) | |
10 | local sound3 = Instance.new("Sound") | |
11 | sound1.SoundId = "rbxassetid://130767866" | |
12 | sound1.Volume = 10 | |
13 | sound2.SoundId = "rbxassetid://142684400" | |
14 | sound2.Volume = 10 | |
15 | sound3.SoundId = "rbxassetid://985132972" | |
16 | sound3.Volume = 10 | |
17 | local particle = Instance.new("ParticleEmitter") | |
18 | particle.LightEmission = 0.2 | |
19 | particle.Texture = "rbxassetid://304748520" | |
20 | particle.Size = NumberSequence.new({ | |
21 | NumberSequenceKeypoint.new(0, 0), | |
22 | NumberSequenceKeypoint.new(0.5, 1), | |
23 | NumberSequenceKeypoint.new(1, 0) | |
24 | }) | |
25 | particle.Acceleration = Vector3.new(0, 0, 0) | |
26 | particle.Lifetime = NumberRange.new(0.15, 0.3) | |
27 | particle.Rate = 50 | |
28 | particle.Rotation = NumberRange.new(0, 360) | |
29 | particle.RotSpeed = NumberRange.new(0, 0) | |
30 | particle.Speed = NumberRange.new(0, 0) | |
31 | local dfj = {} | |
32 | char:WaitForChild("Animate"):Destroy() | |
33 | char:WaitForChild("Humanoid"):WaitForChild("Animator"):Destroy() | |
34 | for i, v in pairs(char:FindFirstChild("Torso"):GetChildren()) do | |
35 | if v:IsA("Motor6D") and v.Name ~= "Neck" then | |
36 | table.insert(dfj, v:Clone()) | |
37 | v:Destroy() | |
38 | end | |
39 | end | |
40 | local state = "idle" | |
41 | local rootpart = char:FindFirstChild("HumanoidRootPart") | |
42 | local rootjoint = rootpart:FindFirstChild("RootJoint") | |
43 | rootjoint.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)) | |
44 | local rarm = Instance.new("Weld", char:FindFirstChild("Right Arm") or nil) | |
45 | rarm.Part0 = char:FindFirstChild("Torso") or nil | |
46 | rarm.Part1 = char:FindFirstChild("Right Arm") or nil | |
47 | rarm.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
48 | rarm.C1 = CFrame.new(-0.5, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
49 | local larm = Instance.new("Weld", char:FindFirstChild("Left Arm") or nil) | |
50 | larm.Part0 = char:FindFirstChild("Torso") or nil | |
51 | larm.Part1 = char:FindFirstChild("Left Arm") or nil | |
52 | larm.C0 = CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
53 | larm.C1 = CFrame.new(0.5, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
54 | local rleg = Instance.new("Weld", char:FindFirstChild("Right Leg") or nil) | |
55 | rleg.Part0 = char:FindFirstChild("Torso") or nil | |
56 | rleg.Part1 = char:FindFirstChild("Right Leg") or nil | |
57 | rleg.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
58 | rleg.C1 = CFrame.new(0.5, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
59 | local lleg = Instance.new("Weld", char:FindFirstChild("Left Leg") or nil) | |
60 | lleg.Part0 = char:FindFirstChild("Torso") or nil | |
61 | lleg.Part1 = char:FindFirstChild("Left Leg") or nil | |
62 | lleg.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
63 | lleg.C1 = CFrame.new(-0.5, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
64 | local neck = char:FindFirstChild("Torso"):FindFirstChild("Neck") or nil | |
65 | neck.Part0 = char:FindFirstChild("Torso") or nil | |
66 | neck.Part1 = char:FindFirstChild("Head") or nil | |
67 | neck.C0 = CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
68 | neck.C1 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
69 | function hitSphere() | |
70 | local function recSearch(par) | |
71 | local tab = {} | |
72 | local function rec(parent) | |
73 | if parent:IsA("Humanoid") and parent ~= char:FindFirstChildOfClass("Humanoid") then | |
74 | table.insert(tab, parent) | |
75 | end | |
76 | for i, v in pairs(parent:GetChildren()) do | |
77 | rec(v) | |
78 | end | |
79 | end | |
80 | rec(par) | |
81 | return tab | |
82 | end | |
83 | local humsFound = {} | |
84 | for i, v in pairs(recSearch(workspace)) do | |
85 | table.insert(humsFound, v) | |
86 | end | |
87 | return humsFound | |
88 | end | |
89 | mouse.Button1Down:connect(function() | |
90 | if state ~= "busy" then | |
91 | state = "busy" | |
92 | do | |
93 | local foundHums = {} | |
94 | local prtcls = {} | |
95 | local sounds = {} | |
96 | local parts = {} | |
97 | sound1:Play() | |
98 | local hit = false | |
99 | local toggle = false | |
100 | local frmcon | |
101 | local frame = 0 | |
102 | frmcon = game:service("RunService").RenderStepped:connect(function() | |
103 | frame = frame + 1 | |
104 | if frame / 4 == math.floor(frame / 4) then | |
105 | if toggle == false then | |
106 | toggle = true | |
107 | else | |
108 | toggle = false | |
109 | end | |
110 | end | |
111 | if toggle == true then | |
112 | rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
113 | lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
114 | rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(45)), spd * 1.5) | |
115 | larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(90)), spd * 1.5) | |
116 | rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(225)), spd * 1.5) | |
117 | neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(-45), math.rad(0)), spd * 1.5) | |
118 | else | |
119 | rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
120 | lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
121 | rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-90)), spd * 1.5) | |
122 | larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-45)), spd * 1.5) | |
123 | rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(135)), spd * 1.5) | |
124 | neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(0)), spd * 1.5) | |
125 | end | |
126 | if frame % 5 == 0 then | |
127 | for i, v in pairs(hitSphere()) do | |
128 | for o, b in pairs(v.Parent:GetChildren()) do | |
129 | if b:IsA("BasePart") and 4 >= (b.Position - rootjoint.Parent.CFrame * CFrame.new(0, 0, -2.25).p).Magnitude then | |
130 | hit = true | |
131 | if foundHums[v] then | |
132 | foundHums[v] = foundHums[v] + 1 | |
133 | else | |
134 | foundHums[v] = 1 | |
135 | local ns = sound3:Clone() | |
136 | ns.Parent = b | |
137 | table.insert(sounds, ns) | |
138 | end | |
139 | if not prtcls[b] then | |
140 | partClone = particle:Clone() | |
141 | partClone.Enabled = false | |
142 | partClone.Parent = b | |
143 | prtcls[b] = partClone | |
144 | end | |
145 | local p = Instance.new("Part") | |
146 | p.Size = Vector3.new(0.2, 0.2, 0.2) | |
147 | p.Color = Color3.new(1, 1, 1) | |
148 | p.TopSurface = "Smooth" | |
149 | p.BottomSurface = "Smooth" | |
150 | p.Anchored = true | |
151 | p.CanCollide = false | |
152 | p.Shape = "Ball" | |
153 | p.CFrame = CFrame.new(b.CFrame.p + Vector3.new(math.random(-10, 10) / 10, math.random(-10, 10) / 10, math.random(-10, 10) / 10)) | |
154 | p.Parent = workspace | |
155 | table.insert(fadeTab, p) | |
156 | parts[b] = b | |
157 | end | |
158 | end | |
159 | end | |
160 | end | |
161 | end) | |
162 | local bucon | |
163 | bucon = mouse.Button1Up:connect(function() | |
164 | frmcon:disconnect() | |
165 | sound1:Stop() | |
166 | state = "idle" | |
167 | if hit == true then | |
168 | sound2:Play() | |
169 | wait(2.7) | |
170 | for i, v in pairs(sounds) do | |
171 | spawn(function() | |
172 | wait(math.random(0, 100) / 600) | |
173 | v.TimePosition = 2.5 | |
174 | v:Play() | |
175 | end) | |
176 | end | |
177 | wait(1.2) | |
178 | for i, v in pairs(prtcls) do | |
179 | v.Enabled = true | |
180 | end | |
181 | wait(1.3) | |
182 | spawn(function() | |
183 | local rcon | |
184 | local frame = 0 | |
185 | rcon = game:service("RunService").RenderStepped:connect(function() | |
186 | frame = frame + 1 | |
187 | for i, v in pairs(sounds) do | |
188 | v.Volume = 10 - frame / 5 | |
189 | if v.Volume <= 0 then | |
190 | v.Volume = 0 | |
191 | v:Destroy() | |
192 | end | |
193 | end | |
194 | if frame >= 200 then | |
195 | for i, v in pairs(sounds) do | |
196 | v:Destroy() | |
197 | end | |
198 | end | |
199 | end) | |
200 | end) | |
201 | for i, v in pairs(parts) do | |
202 | v.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100)) | |
203 | v.Velocity = v.Velocity + Vector3.new(0, 20, 0) | |
204 | local bvel = Instance.new("BodyVelocity", v) | |
205 | bvel.MaxForce = Vector3.new(1000000, 1000000, 1000000) | |
206 | bvel.Velocity = Vector3.new(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
207 | game:service("Debris"):AddItem(bvel, 0.5) | |
208 | end | |
209 | for i, v in pairs(foundHums) do | |
210 | if i.MaxHealth >= math.huge then | |
211 | i.MaxHealth = 100 | |
212 | end | |
213 | i.Health = 0 | |
214 | - | i.Torso.CFrame.new() |
214 | + | i.Torso.CFrame = CFrame.new(0,0,0) |
215 | local kablmaoXDXD = Instance.new("Sound", game.Players.LocalPlayer.Character) | |
216 | kablmaoXDXD.SoundId = "rbxassetid://141679994" | |
217 | kablmaoXDXD.Volume = 10 | |
218 | kablmaoXDXD:Play() | |
219 | local ball1 = Instance.new("Part", game.Players.LocalPlayer.Character) | |
220 | ball1.Size = Vector3.new(1,1,1) | |
221 | ball1.Material = "Neon" | |
222 | ball1.Anchored = true | |
223 | ball1.Transparency = 0.3 | |
224 | ball1.BrickColor = BrickColor.new("Magenta") | |
225 | ball1.CanCollide = false | |
226 | ball1.CFrame = i.Torso.CFrame | |
227 | local ball11 = Instance.new("Part", game.Players.LocalPlayer.Character) | |
228 | ball11.Size = Vector3.new(1,1,1) | |
229 | ball11.Material = "Neon" | |
230 | ball11.Anchored = true | |
231 | ball11.Transparency = 0.3 | |
232 | ball11.BrickColor = BrickColor.new("Royal purple") | |
233 | ball11.CanCollide = false | |
234 | ball11.CFrame = i.Torso.CFrame | |
235 | local cf = ball1.CFrame | |
236 | ball1:BreakJoints() | |
237 | local cfval = 0 | |
238 | local cfval1 = 0 | |
239 | for i = 1,260 do | |
240 | game.Players.LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1)) | |
241 | cfval1 = cfval1 - 1 | |
242 | cfval = cfval + 1 | |
243 | ball1.Size = ball1.Size + Vector3.new(0.4,0.4,0.4) | |
244 | ball1.CFrame = cf * CFrame.fromEulerAnglesXYZ(0,cfval,cfval + math.random(-1,1)) | |
245 | -- | |
246 | ball11.Size = ball1.Size + Vector3.new(0.2,0.2,0.2) | |
247 | ball11.CFrame = cf * CFrame.fromEulerAnglesXYZ(0,cfval1,cfval1 + math.random(-1,1)) | |
248 | wait() | |
249 | end | |
250 | for i = 1,20 do | |
251 | game.Players.LocalPlayer.Character.Humanoid.CameraOffset = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1)) | |
252 | cfval1 = cfval1 - 1 | |
253 | cfval = cfval + 1 | |
254 | ball1.Transparency = ball1.Transparency + 0.05 | |
255 | ball1.Size = ball1.Size + Vector3.new(0.4,0.4,0.4) | |
256 | ball1.CFrame = cf * CFrame.fromEulerAnglesXYZ(0,cfval,cfval + math.random(-1,1)) | |
257 | -- | |
258 | ball11.Transparency = ball11.Transparency + 0.05 | |
259 | ball11.Size = ball1.Size + Vector3.new(0.2,0.2,0.2) | |
260 | ball11.CFrame = cf * CFrame.fromEulerAnglesXYZ(0,cfval1,cfval1 + math.random(-1,1)) | |
261 | wait() | |
262 | end | |
263 | wait(0.7) | |
264 | for i, v in pairs(prtcls) do | |
265 | v.Enabled = false | |
266 | end | |
267 | end | |
268 | bucon:disconnect() | |
269 | end | |
270 | end | |
271 | )end | |
272 | - | end) |
272 | + | |
273 | game:GetService("RunService").Heartbeat:connect(function() | |
274 | for i, v in pairs(fadeTab) do | |
275 | v.Transparency = v.Transparency + 0.1 | |
276 | local savecf = v.CFrame | |
277 | v.Size = v.Size + Vector3.new(0.3, 0.3, 0.3) | |
278 | v.CFrame = savecf | |
279 | end | |
280 | local isub = 0 | |
281 | for i = 1, #fadeTab do | |
282 | if fadeTab[i - isub].Transparency >= 1 then | |
283 | fadeTab[i - isub]:Destroy() | |
284 | table.remove(fadeTab, i - isub) | |
285 | isub = isub + 1 | |
286 | end | |
287 | end | |
288 | char:FindFirstChild("Humanoid").WalkSpeed = 26 | |
289 | spd = 0.2 * char:FindFirstChild("Humanoid").WalkSpeed / 16 | |
290 | if state ~= "busy" then | |
291 | local ray = Ray.new(rootpart.Position, Vector3.new(0, -4, 0)) | |
292 | local part, pos, normal = workspace:FindPartOnRayWithIgnoreList(ray, char:GetChildren(), false, true) | |
293 | if rootpart.Velocity.Magnitude > 0.5 and part ~= nil then | |
294 | state = "running" | |
295 | elseif rootpart.Velocity.Magnitude <= 0.5 and part ~= nil then | |
296 | state = "idle" | |
297 | elseif 0 < rootpart.Velocity.Y and part == nil then | |
298 | state = "jumping" | |
299 | elseif 0 >= rootpart.Velocity.Y and part == nil then | |
300 | state = "falling" | |
301 | end | |
302 | if state == "idle" then | |
303 | rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
304 | lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
305 | rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5 + math.cos(tick() + 0.5) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad((math.cos(tick()) + 1) / 16) * 20), spd) | |
306 | larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5 + math.cos(tick() + 0.5) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-(math.cos(tick()) + 1) / 16) * 20), spd) | |
307 | rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd) | |
308 | neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
309 | elseif state == "running" then | |
310 | rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - -math.sin(tick() * 8 + 90) / 8, math.sin(tick() * 8 + 90) / 10) * CFrame.Angles(math.rad(math.sin(tick() * 8) * 60), math.rad(0), math.rad(0)), spd) | |
311 | lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.sin(tick() * 8 + 90) / 8, -math.sin(tick() * 8 + 90) / 10) * CFrame.Angles(-math.rad(math.sin(tick() * 8) * 60), math.rad(0), math.rad(0)), spd) | |
312 | rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(math.sin(tick() * 8) * 80), math.rad(0), math.rad(0)), spd) | |
313 | larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(-math.rad(math.sin(tick() * 8) * 80), math.rad(0), math.rad(0)), spd) | |
314 | rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-110), math.rad(0), math.rad(180)), spd) | |
315 | neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(20), math.rad(0), math.rad(0)), spd) | |
316 | elseif state == "jumping" then | |
317 | rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
318 | lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
319 | rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
320 | larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
321 | rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd) | |
322 | neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
323 | elseif state == "falling" then | |
324 | rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
325 | lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
326 | rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
327 | larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
328 | rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd) | |
329 | neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd) | |
330 | end | |
331 | end | |
332 | - | end) |
332 | + | |
333 | - | warn("Loaded! Time elapsed: " .. tick() - oldtick) |
333 | + | )end |
334 | )warn("Loaded! Time elapsed: " .. tick() - oldtick) |