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