SHOW:
|
|
- or go back to the newest paste.
1 | --By Rufus14 | |
2 | --Converted with ttyyuu12345's model to script plugin v4 | |
3 | function sandbox(var,func) | |
4 | local env = getfenv(func) | |
5 | local newenv = setmetatable({},{ | |
6 | __index = function(self,k) | |
7 | if k=="script" then | |
8 | return var | |
9 | else | |
10 | return env[k] | |
11 | end | |
12 | end, | |
13 | }) | |
14 | setfenv(func,newenv) | |
15 | return func | |
16 | end | |
17 | cors = {} | |
18 | mas = Instance.new("Model",game:GetService("Lighting")) | |
19 | Tool0 = Instance.new("Tool") | |
20 | Part1 = Instance.new("Part") | |
21 | Sound2 = Instance.new("Sound") | |
22 | SpecialMesh3 = Instance.new("SpecialMesh") | |
23 | Sound4 = Instance.new("Sound") | |
24 | Sound5 = Instance.new("Sound") | |
25 | Sound6 = Instance.new("Sound") | |
26 | Trail7 = Instance.new("Trail") | |
27 | Sound8 = Instance.new("Sound") | |
28 | Sound9 = Instance.new("Sound") | |
29 | Sound10 = Instance.new("Sound") | |
30 | Script11 = Instance.new("Script") | |
31 | LocalScript12 = Instance.new("LocalScript") | |
32 | RemoteEvent13 = Instance.new("RemoteEvent") | |
33 | Tool0.Name = "Combat Knife" | |
34 | Tool0.Parent = mas | |
35 | Tool0.ToolTip = "Hold left mouse button to throw." | |
36 | Part1.Name = "Handle" | |
37 | Part1.Parent = Tool0 | |
38 | Part1.CFrame = CFrame.new(74.2750092, 1.40000033, -30.2500057, -1, 0, 0, 0, 1, 0, 0, 0, -1) | |
39 | Part1.Orientation = Vector3.new(0, 180, 0) | |
40 | Part1.Position = Vector3.new(74.2750092, 1.40000033, -30.2500057) | |
41 | Part1.Rotation = Vector3.new(-180, 0, -180) | |
42 | Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667) | |
43 | Part1.Size = Vector3.new(0.149999991, 1.90000105, 0.699999988) | |
44 | Part1.BottomSurface = Enum.SurfaceType.Smooth | |
45 | Part1.BrickColor = BrickColor.new("Really black") | |
46 | Part1.Material = Enum.Material.DiamondPlate | |
47 | Part1.Reflectance = 0.0099999997764826 | |
48 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
49 | Part1.brickColor = BrickColor.new("Really black") | |
50 | Part1.FormFactor = Enum.FormFactor.Custom | |
51 | Part1.formFactor = Enum.FormFactor.Custom | |
52 | Sound2.Name = "Swoosh" | |
53 | Sound2.Parent = Part1 | |
54 | Sound2.Pitch = 1.5 | |
55 | Sound2.PlaybackSpeed = 1.5 | |
56 | Sound2.SoundId = "http://www.roblox.com/asset?id=153647529" | |
57 | SpecialMesh3.Parent = Part1 | |
58 | SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=121944778" | |
59 | SpecialMesh3.Scale = Vector3.new(0.699999988, 0.699999988, 0.699999988) | |
60 | SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=172752354" | |
61 | SpecialMesh3.MeshType = Enum.MeshType.FileMesh | |
62 | Sound4.Name = "Equip" | |
63 | Sound4.Parent = Part1 | |
64 | Sound4.Pitch = 1.2000000476837 | |
65 | Sound4.PlaybackSpeed = 1.2000000476837 | |
66 | Sound4.SoundId = "rbxassetid://153647514" | |
67 | Sound5.Name = "Stab" | |
68 | Sound5.Parent = Part1 | |
69 | Sound5.SoundId = "rbxassetid://2782131222" | |
70 | Sound5.Volume = 1 | |
71 | Sound6.Name = "Unequip" | |
72 | Sound6.Parent = Part1 | |
73 | Sound6.SoundId = "rbxassetid://769464514" | |
74 | Trail7.Parent = Part1 | |
75 | local attach1 = Instance.new("Attachment", Part1) | |
76 | local attach2 = Instance.new("Attachment", Part1) | |
77 | - | Tool0.Parent = owner.Character |
77 | + | |
78 | - | coroutine.wrap(function() |
78 | + | |
79 | Trail7.Attachment0 = attach1 | |
80 | Trail7.Attachment1 = attach2 | |
81 | Trail7.Enabled = false | |
82 | Trail7.LightInfluence = 1 | |
83 | - | tool = Tool0 |
83 | + | |
84 | Trail7.Lifetime = 0.15000000596046 | |
85 | Sound8.Name = "Hitmarker" | |
86 | Sound8.Parent = Part1 | |
87 | Sound8.SoundId = "rbxassetid://160432334" | |
88 | Sound9.Name = "Hit" | |
89 | Sound9.Parent = Part1 | |
90 | Sound9.Pitch = 3.2000000476837 | |
91 | Sound9.PlaybackSpeed = 3.2000000476837 | |
92 | Sound9.SoundId = "http://www.roblox.com/asset/?id=58831920" | |
93 | Sound10.Name = "Spray" | |
94 | Sound10.Parent = Part1 | |
95 | Sound10.SoundId = "rbxassetid://843338638" | |
96 | Script11.Parent = Tool0 | |
97 | table.insert(cors,sandbox(Script11,function() | |
98 | --By Rufus14 | |
99 | canattack = true | |
100 | - | ragdolltime = 1.5 |
100 | + | |
101 | equipped = false | |
102 | tool = script.Parent | |
103 | handle = tool.Handle | |
104 | equipsound = handle.Equip | |
105 | unequipsound = handle.Unequip | |
106 | stabsound = handle.Stab | |
107 | hitsound = handle.Hit | |
108 | spraysound = handle.Spray | |
109 | - | swooshsound.PlaybackSpeed = 1+(math.random(-2,6)/20) |
109 | + | |
110 | hitmarkersound = handle.Hitmarker | |
111 | swooshsound = handle.Swoosh | |
112 | owner = nil | |
113 | character = nil | |
114 | trail = handle.Trail | |
115 | skins = {"http://www.roblox.com/asset/?id=1587951817","http://www.roblox.com/asset/?id=197196512", "http://www.roblox.com/asset/?id=873992779", "http://www.roblox.com/asset/?id=255807446", "http://www.roblox.com/asset/?id=168000980", "http://www.roblox.com/asset/?id=874577611", "http://www.roblox.com/asset/?id=360376241", "http://www.roblox.com/asset/?id=1905836992", "http://www.roblox.com/asset/?id=155682302", "http://www.roblox.com/asset/?id=165164425","rbxassetid://389248139","http://www.roblox.com/asset/?id=4355817810", "rbxassetid://559676009","http://www.roblox.com/asset/?id=795156885","http://www.roblox.com/asset/?id=228691514","http://www.roblox.com/asset/?id=159953078","http://www.roblox.com/asset/?id=162822166","rbxassetid://998076663","http://www.roblox.com/asset/?id=161024169","http://www.roblox.com/asset/?id=163093131","http://www.roblox.com/asset/?id=175680432","http://www.roblox.com/asset/?id=201595653","http://www.roblox.com/asset/?id=161380326","http://www.roblox.com/asset/?id=367624667","http://www.roblox.com/asset/?id=173946596","rbxassetid://163069061"} | |
116 | skinnumber = 0 | |
117 | step = game:GetService("RunService").Stepped | |
118 | swingnum = 0 | |
119 | ragdolltime = 6 | |
120 | spinning = false | |
121 | canthrow = false | |
122 | knifeeffect = "default" | |
123 | throwpos = nil | |
124 | pressed = false | |
125 | function spinanimation() | |
126 | local spinvalue = 0 | |
127 | spinning = true | |
128 | swooshsound.PlaybackSpeed = 5+(math.random(-2,6)/20) | |
129 | swooshsound:Play() | |
130 | for i = 1,14 do | |
131 | if cananimate then | |
132 | tool.Grip = tool.Grip * CFrame.fromEulerAnglesXYZ(-0.5,0,0) | |
133 | step:wait() | |
134 | end | |
135 | end | |
136 | spinning = false | |
137 | trail.Enabled = false | |
138 | end | |
139 | -- | |
140 | event.OnServerEvent:connect(function(player, what, where) | |
141 | if player == owner then | |
142 | if what == "throw" and canthrow and not canattack then | |
143 | throwpos = where.p | |
144 | end | |
145 | if what == "skin" then | |
146 | spraysound:Play() | |
147 | skinnumber = skinnumber + 1 | |
148 | knifeeffect = "default" | |
149 | stabsound.Volume = 1 | |
150 | swooshsound.SoundId = "http://www.roblox.com/asset?id=153647529" | |
151 | stabsound.SoundId = "rbxassetid://2782131222" | |
152 | if skinnumber > table.getn(skins) then | |
153 | skinnumber = 0 | |
154 | handle:findFirstChildOfClass("SpecialMesh").TextureId = "http://www.roblox.com/asset/?id=172752354" | |
155 | end | |
156 | for i = 0,#skins do | |
157 | if i == skinnumber and i ~= 0 then | |
158 | handle:findFirstChildOfClass("SpecialMesh").TextureId = skins[i] | |
159 | end | |
160 | end | |
161 | --special abilites | |
162 | if handle:findFirstChildOfClass("SpecialMesh") then | |
163 | local specialmesh = handle:findFirstChildOfClass("SpecialMesh") | |
164 | if specialmesh.TextureId == "http://www.roblox.com/asset/?id=197196512" then | |
165 | - | --print(knifeeffect) |
165 | + | |
166 | knifeeffect = "clown noons be like:" | |
167 | elseif specialmesh.TextureId == "http://www.roblox.com/asset/?id=1587951817" then | |
168 | knifeeffect = "bro you could buy cs s bro" | |
169 | elseif specialmesh.TextureId == "http://www.roblox.com/asset/?id=360376241" then | |
170 | stabsound.SoundId = "rbxassetid://995908246" | |
171 | knifeeffect = "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" | |
172 | elseif specialmesh.TextureId == "http://www.roblox.com/asset/?id=163093131" then | |
173 | stabsound.SoundId = "rbxassetid://3258183679" | |
174 | print("hamburger") | |
175 | elseif specialmesh.TextureId == "http://www.roblox.com/asset/?id=1905836992" then | |
176 | stabsound.SoundId = "rbxassetid://1304248173" | |
177 | stabsound.Volume = 0.2 | |
178 | print("rock n roll mcdonalds") | |
179 | elseif specialmesh.TextureId == "rbxassetid://163069061" then | |
180 | stabsound.SoundId = "rbxassetid://1058021195" | |
181 | print("pizza") | |
182 | end | |
183 | end | |
184 | print(knifeeffect) | |
185 | end | |
186 | end | |
187 | end) | |
188 | tool.Activated:connect(function() | |
189 | pressed = true | |
190 | end) | |
191 | tool.Deactivated:connect(function() | |
192 | pressed = false | |
193 | end) | |
194 | -- | |
195 | function funnyeffect(startcf, what) | |
196 | if knifeeffect == "clown noons be like:" then | |
197 | for i = 1,math.random(4,6) do | |
198 | local ball = Instance.new("Part", workspace) | |
199 | ball.Size = Vector3.new(0.6,0.6,0.6) | |
200 | ball.BrickColor = BrickColor.Random() | |
201 | ball.CanCollide = false | |
202 | ball.CFrame = startcf | |
203 | ball.Shape = "Ball" | |
204 | local vel = Instance.new("BodyVelocity", ball) | |
205 | vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge) | |
206 | vel.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30)) | |
207 | game.Debris:AddItem(vel, 0.1) | |
208 | game.Debris:AddItem(ball, 5) | |
209 | end | |
210 | if what.Parent:findFirstChild("Head") then | |
211 | if not what.Parent.Head:findFirstChild("yo mama moment") then | |
212 | local honkhonk = Instance.new("Part", what.Parent.Head) | |
213 | honkhonk.Size = Vector3.new(0.4,0.4,0.4) | |
214 | honkhonk.BrickColor = BrickColor.new("Really red") | |
215 | honkhonk.CanCollide = false | |
216 | honkhonk.Material = "Neon" | |
217 | honkhonk.Name = "yo mama moment" | |
218 | honkhonk.Shape = "Ball" | |
219 | honkhonk:BreakJoints() | |
220 | local weld = Instance.new("Weld", honkhonk) | |
221 | weld.Part0 = what.Parent.Head | |
222 | weld.Part1 = honkhonk | |
223 | weld.C0 = CFrame.new(0,0,-what.Parent.Head.Size.z/2) | |
224 | end | |
225 | end | |
226 | elseif knifeeffect == "bro you could buy cs s bro" then | |
227 | if what.Name == "Head" then | |
228 | for i,v in pairs(what.Parent:GetDescendants()) do | |
229 | if v.ClassName == "MeshPart" or v.ClassName == "Part" and not v:findFirstChild("missing") then | |
230 | local decal = Instance.new("Texture", v) | |
231 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
232 | decal.Face = "Top" | |
233 | decal.Name = "missing" | |
234 | local decal = Instance.new("Texture", v) | |
235 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
236 | decal.Face = "Front" | |
237 | decal.Name = "missing" | |
238 | local decal = Instance.new("Texture", v) | |
239 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
240 | decal.Face = "Back" | |
241 | decal.Name = "missing" | |
242 | local decal = Instance.new("Texture", v) | |
243 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
244 | decal.Face = "Bottom" | |
245 | decal.Name = "missing" | |
246 | local decal = Instance.new("Texture", v) | |
247 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
248 | decal.Face = "Left" | |
249 | decal.Name = "missing" | |
250 | local decal = Instance.new("Texture", v) | |
251 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
252 | decal.Face = "Right" | |
253 | decal.Name = "missing" | |
254 | end | |
255 | end | |
256 | else | |
257 | if not what:findFirstChild("missing") then | |
258 | local decal = Instance.new("Texture", what) | |
259 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
260 | decal.Face = "Top" | |
261 | decal.Name = "missing" | |
262 | local decal = Instance.new("Texture", what) | |
263 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
264 | decal.Face = "Front" | |
265 | decal.Name = "missing" | |
266 | local decal = Instance.new("Texture", what) | |
267 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
268 | decal.Face = "Back" | |
269 | decal.Name = "missing" | |
270 | local decal = Instance.new("Texture", what) | |
271 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
272 | decal.Face = "Bottom" | |
273 | decal.Name = "missing" | |
274 | local decal = Instance.new("Texture", what) | |
275 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
276 | decal.Face = "Left" | |
277 | decal.Name = "missing" | |
278 | local decal = Instance.new("Texture", what) | |
279 | decal.Texture = "http://www.roblox.com/asset/?id=1587951817" | |
280 | decal.Face = "Right" | |
281 | decal.Name = "missing" | |
282 | end | |
283 | end | |
284 | elseif knifeeffect == "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
285 | for i,v in pairs(what.Parent:GetDescendants()) do | |
286 | if v.ClassName == "Part" or v.ClassName == "MeshPart" or v.ClassName == "Decal" or v.ClassName == "Texture" then | |
287 | if v.ClassName == "Part" or v.ClassName == "MeshPart" then | |
288 | v.BrickColor = BrickColor.Random() | |
289 | v.Material = "Neon" | |
290 | end | |
291 | coroutine.wrap(function() | |
292 | for i = 1,150 do | |
293 | v.Transparency = v.Transparency + 0.0075 | |
294 | step:wait() | |
295 | end | |
296 | v:destroy() | |
297 | end)() | |
298 | - | local dmg = math.random(20,50) |
298 | + | |
299 | end | |
300 | end | |
301 | end | |
302 | -- | |
303 | function damage() | |
304 | for i,v in pairs(workspace:GetDescendants()) do | |
305 | if v.ClassName == "Model" then | |
306 | local head = v:findFirstChild("Head") | |
307 | local humanoid = v:findFirstChildOfClass("Humanoid") | |
308 | local torso = v:findFirstChild("Torso") | |
309 | local ragdolled = v:findFirstChild("ragdolledknife") | |
310 | if humanoid and head and not ragdolled then | |
311 | if (head.Position - handle.Position).magnitude < 2 and v ~= character and humanoid.Health > 0 then | |
312 | funnyeffect(head.CFrame, head) | |
313 | stabsound.PlaybackSpeed = 1+(math.random(-4,4)/10) | |
314 | stabsound:Play() | |
315 | hitmarkersound:Play() | |
316 | if knifeeffect ~= "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
317 | local dmg = math.random(10000000,10000000) | |
318 | if humanoid.Health <= dmg then | |
319 | humanoid.Health = 0 | |
320 | ragdollkill(v) | |
321 | end | |
322 | humanoid.Health = humanoid.Health - dmg | |
323 | end | |
324 | local ragdolledknife = Instance.new("BoolValue", v) | |
325 | ragdolledknife.Name = "ragdolledknife" | |
326 | local velocity = Instance.new("BodyVelocity", head) | |
327 | velocity.MaxForce = Vector3.new(math.huge,0,math.huge) | |
328 | velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * math.random(5,15) | |
329 | humanoid.PlatformStand = true | |
330 | coroutine.wrap(function() | |
331 | wait(ragdolltime) | |
332 | humanoid.PlatformStand = false | |
333 | end)() | |
334 | game.Debris:AddItem(ragdolledknife, 1) | |
335 | game.Debris:AddItem(velocity, 0.2) | |
336 | if torso then | |
337 | coroutine.wrap(function() | |
338 | humanoid = v:WaitForChild("Humanoid") | |
339 | local ragdoll = v | |
340 | if ragdoll:findFirstChild("Right Arm") then | |
341 | local glue = Instance.new("Glue", ragdoll.Torso) | |
342 | glue.Part0 = ragdoll.Torso | |
343 | glue.Part1 = ragdoll:findFirstChild("Right Arm") | |
344 | glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
345 | glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
346 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm")) | |
347 | limbcollider.Size = Vector3.new(1.4,1,1) | |
348 | limbcollider.Shape = "Cylinder" | |
349 | limbcollider.Transparency = 1 | |
350 | limbcollider.Name = "LimbCollider" | |
351 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
352 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm") | |
353 | limbcolliderweld.Part1 = limbcollider | |
354 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
355 | coroutine.wrap(function() | |
356 | if ragdoll.Torso:findFirstChild("Right Shoulder") then | |
357 | local limbclone = ragdoll.Torso:findFirstChild("Right Shoulder"):Clone() | |
358 | ragdoll.Torso:findFirstChild("Right Shoulder"):destroy() | |
359 | coroutine.wrap(function() | |
360 | wait(ragdolltime) | |
361 | limbclone.Parent = ragdoll.Torso | |
362 | limbclone.Part0 = ragdoll.Torso | |
363 | limbclone.Part1 = ragdoll["Right Arm"] | |
364 | end)() | |
365 | end | |
366 | wait(ragdolltime) | |
367 | glue:destroy() | |
368 | limbcollider:destroy() | |
369 | limbcolliderweld:destroy() | |
370 | end)() | |
371 | end | |
372 | if ragdoll:findFirstChild("Left Arm") then | |
373 | local glue = Instance.new("Glue", ragdoll.Torso) | |
374 | glue.Part0 = ragdoll.Torso | |
375 | glue.Part1 = ragdoll:findFirstChild("Left Arm") | |
376 | glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
377 | glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
378 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm")) | |
379 | limbcollider.Size = Vector3.new(1.4,1,1) | |
380 | limbcollider.Shape = "Cylinder" | |
381 | limbcollider.Name = "LimbCollider" | |
382 | limbcollider.Transparency = 1 | |
383 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
384 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm") | |
385 | limbcolliderweld.Part1 = limbcollider | |
386 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
387 | coroutine.wrap(function() | |
388 | if ragdoll.Torso:findFirstChild("Left Shoulder") then | |
389 | local limbclone = ragdoll.Torso:findFirstChild("Left Shoulder"):Clone() | |
390 | ragdoll.Torso:findFirstChild("Left Shoulder"):destroy() | |
391 | coroutine.wrap(function() | |
392 | wait(ragdolltime) | |
393 | limbclone.Parent = ragdoll.Torso | |
394 | limbclone.Part0 = ragdoll.Torso | |
395 | limbclone.Part1 = ragdoll["Left Arm"] | |
396 | end)() | |
397 | end | |
398 | wait(ragdolltime) | |
399 | glue:destroy() | |
400 | limbcollider:destroy() | |
401 | limbcolliderweld:destroy() | |
402 | end)() | |
403 | end | |
404 | if ragdoll:findFirstChild("Left Leg") then | |
405 | local glue = Instance.new("Glue", ragdoll.Torso) | |
406 | glue.Part0 = ragdoll.Torso | |
407 | glue.Part1 = ragdoll:findFirstChild("Left Leg") | |
408 | glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
409 | glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
410 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg")) | |
411 | limbcollider.Size = Vector3.new(1.5,1,1) | |
412 | limbcollider.Shape = "Cylinder" | |
413 | limbcollider.Name = "LimbCollider" | |
414 | limbcollider.Transparency = 1 | |
415 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
416 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg") | |
417 | limbcolliderweld.Part1 = limbcollider | |
418 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0) | |
419 | coroutine.wrap(function() | |
420 | if ragdoll.Torso:findFirstChild("Left Hip") then | |
421 | local limbclone = ragdoll.Torso:findFirstChild("Left Hip"):Clone() | |
422 | ragdoll.Torso:findFirstChild("Left Hip"):destroy() | |
423 | coroutine.wrap(function() | |
424 | wait(ragdolltime) | |
425 | limbclone.Parent = ragdoll.Torso | |
426 | limbclone.Part0 = ragdoll.Torso | |
427 | limbclone.Part1 = ragdoll["Left Leg"] | |
428 | end)() | |
429 | end | |
430 | wait(ragdolltime) | |
431 | glue:destroy() | |
432 | limbcollider:destroy() | |
433 | limbcolliderweld:destroy() | |
434 | end)() | |
435 | end | |
436 | if ragdoll:findFirstChild("Right Leg") then | |
437 | local glue = Instance.new("Glue", ragdoll.Torso) | |
438 | glue.Part0 = ragdoll.Torso | |
439 | glue.Part1 = ragdoll:findFirstChild("Right Leg") | |
440 | glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
441 | glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
442 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg")) | |
443 | limbcollider.Size = Vector3.new(1.5,1,1) | |
444 | limbcollider.Shape = "Cylinder" | |
445 | limbcollider.Name = "LimbCollider" | |
446 | limbcollider.Transparency = 1 | |
447 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
448 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg") | |
449 | limbcolliderweld.Part1 = limbcollider | |
450 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0) | |
451 | coroutine.wrap(function() | |
452 | if ragdoll.Torso:findFirstChild("Right Hip") then | |
453 | local limbclone = ragdoll.Torso:findFirstChild("Right Hip"):Clone() | |
454 | ragdoll.Torso:findFirstChild("Right Hip"):destroy() | |
455 | coroutine.wrap(function() | |
456 | wait(ragdolltime) | |
457 | limbclone.Parent = ragdoll.Torso | |
458 | limbclone.Part0 = ragdoll.Torso | |
459 | limbclone.Part1 = ragdoll["Right Leg"] | |
460 | end)() | |
461 | end | |
462 | wait(ragdolltime) | |
463 | glue:destroy() | |
464 | - | local dmg = math.random(20,50) |
464 | + | |
465 | limbcolliderweld:destroy() | |
466 | end)() | |
467 | end | |
468 | end)() | |
469 | end | |
470 | end | |
471 | end | |
472 | end | |
473 | end | |
474 | end | |
475 | function ragdollplr(v) | |
476 | local head = v.Head | |
477 | local torso = v:findFirstChild("Torso") | |
478 | local humanoid = v:findFirstChildOfClass("Humanoid") | |
479 | stabsound.PlaybackSpeed = 1+(math.random(-4,4)/10) | |
480 | stabsound:Play() | |
481 | hitmarkersound:Play() | |
482 | - | game.Debris:AddItem(velocity, 0.2) |
482 | + | |
483 | local dmg = math.random(10000000,10000000) | |
484 | if humanoid.Health <= dmg then | |
485 | humanoid.Health = 0 | |
486 | ragdollkill(v) | |
487 | end | |
488 | humanoid.Health = humanoid.Health - dmg | |
489 | end | |
490 | local ragdolledknife = Instance.new("BoolValue", v) | |
491 | ragdolledknife.Name = "ragdolledknife" | |
492 | local velocity = Instance.new("BodyVelocity", head) | |
493 | velocity.MaxForce = Vector3.new(math.huge,0,math.huge) | |
494 | velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * math.random(5,15) | |
495 | humanoid.PlatformStand = true | |
496 | coroutine.wrap(function() | |
497 | wait(ragdolltime) | |
498 | humanoid.PlatformStand = false | |
499 | end)() | |
500 | game.Debris:AddItem(ragdolledknife, ragdolltime) | |
501 | game.Debris:AddItem(velocity, 100) | |
502 | if torso then | |
503 | coroutine.wrap(function() | |
504 | humanoid = v:WaitForChild("Humanoid") | |
505 | local ragdoll = v | |
506 | if ragdoll:findFirstChild("Right Arm") then | |
507 | local glue = Instance.new("Glue", ragdoll.Torso) | |
508 | glue.Part0 = ragdoll.Torso | |
509 | glue.Part1 = ragdoll:findFirstChild("Right Arm") | |
510 | glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
511 | glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
512 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm")) | |
513 | limbcollider.Size = Vector3.new(1.4,1,1) | |
514 | limbcollider.Shape = "Cylinder" | |
515 | limbcollider.Transparency = 1 | |
516 | limbcollider.Name = "LimbCollider" | |
517 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
518 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm") | |
519 | limbcolliderweld.Part1 = limbcollider | |
520 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
521 | coroutine.wrap(function() | |
522 | if ragdoll.Torso:findFirstChild("Right Shoulder") then | |
523 | local limbclone = ragdoll.Torso:findFirstChild("Right Shoulder"):Clone() | |
524 | ragdoll.Torso:findFirstChild("Right Shoulder"):destroy() | |
525 | coroutine.wrap(function() | |
526 | wait(ragdolltime) | |
527 | if not ragdoll:findFirstChild("Torso") then | |
528 | return | |
529 | end | |
530 | limbclone.Parent = ragdoll.Torso | |
531 | limbclone.Part0 = ragdoll.Torso | |
532 | limbclone.Part1 = ragdoll["Right Arm"] | |
533 | end)() | |
534 | end | |
535 | wait(ragdolltime) | |
536 | glue:destroy() | |
537 | limbcollider:destroy() | |
538 | limbcolliderweld:destroy() | |
539 | end)() | |
540 | end | |
541 | if ragdoll:findFirstChild("Left Arm") then | |
542 | local glue = Instance.new("Glue", ragdoll.Torso) | |
543 | glue.Part0 = ragdoll.Torso | |
544 | glue.Part1 = ragdoll:findFirstChild("Left Arm") | |
545 | glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
546 | glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
547 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm")) | |
548 | limbcollider.Size = Vector3.new(1.4,1,1) | |
549 | limbcollider.Shape = "Cylinder" | |
550 | limbcollider.Name = "LimbCollider" | |
551 | limbcollider.Transparency = 1 | |
552 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
553 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm") | |
554 | limbcolliderweld.Part1 = limbcollider | |
555 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
556 | coroutine.wrap(function() | |
557 | if ragdoll.Torso:findFirstChild("Left Shoulder") then | |
558 | local limbclone = ragdoll.Torso:findFirstChild("Left Shoulder"):Clone() | |
559 | ragdoll.Torso:findFirstChild("Left Shoulder"):destroy() | |
560 | coroutine.wrap(function() | |
561 | wait(ragdolltime) | |
562 | if not ragdoll:findFirstChild("Torso") then | |
563 | return | |
564 | end | |
565 | limbclone.Parent = ragdoll.Torso | |
566 | limbclone.Part0 = ragdoll.Torso | |
567 | limbclone.Part1 = ragdoll["Left Arm"] | |
568 | end)() | |
569 | end | |
570 | wait(ragdolltime) | |
571 | glue:destroy() | |
572 | limbcollider:destroy() | |
573 | limbcolliderweld:destroy() | |
574 | end)() | |
575 | end | |
576 | if ragdoll:findFirstChild("Left Leg") then | |
577 | local glue = Instance.new("Glue", ragdoll.Torso) | |
578 | glue.Part0 = ragdoll.Torso | |
579 | glue.Part1 = ragdoll:findFirstChild("Left Leg") | |
580 | glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
581 | glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
582 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg")) | |
583 | limbcollider.Size = Vector3.new(1.5,1,1) | |
584 | limbcollider.Shape = "Cylinder" | |
585 | limbcollider.Name = "LimbCollider" | |
586 | limbcollider.Transparency = 1 | |
587 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
588 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg") | |
589 | limbcolliderweld.Part1 = limbcollider | |
590 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0) | |
591 | coroutine.wrap(function() | |
592 | if ragdoll.Torso:findFirstChild("Left Hip") then | |
593 | local limbclone = ragdoll.Torso:findFirstChild("Left Hip"):Clone() | |
594 | ragdoll.Torso:findFirstChild("Left Hip"):destroy() | |
595 | coroutine.wrap(function() | |
596 | wait(ragdolltime) | |
597 | if not ragdoll:findFirstChild("Torso") then | |
598 | return | |
599 | end | |
600 | limbclone.Parent = ragdoll.Torso | |
601 | limbclone.Part0 = ragdoll.Torso | |
602 | limbclone.Part1 = ragdoll["Left Leg"] | |
603 | end)() | |
604 | end | |
605 | wait(ragdolltime) | |
606 | glue:destroy() | |
607 | limbcollider:destroy() | |
608 | limbcolliderweld:destroy() | |
609 | end)() | |
610 | end | |
611 | if ragdoll:findFirstChild("Right Leg") then | |
612 | local glue = Instance.new("Glue", ragdoll.Torso) | |
613 | glue.Part0 = ragdoll.Torso | |
614 | glue.Part1 = ragdoll:findFirstChild("Right Leg") | |
615 | glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
616 | glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
617 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg")) | |
618 | limbcollider.Size = Vector3.new(1.5,1,1) | |
619 | limbcollider.Shape = "Cylinder" | |
620 | limbcollider.Name = "LimbCollider" | |
621 | limbcollider.Transparency = 1 | |
622 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
623 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg") | |
624 | limbcolliderweld.Part1 = limbcollider | |
625 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.2,0,0) | |
626 | coroutine.wrap(function() | |
627 | if ragdoll.Torso:findFirstChild("Right Hip") then | |
628 | local limbclone = ragdoll.Torso:findFirstChild("Right Hip"):Clone() | |
629 | ragdoll.Torso:findFirstChild("Right Hip"):destroy() | |
630 | coroutine.wrap(function() | |
631 | wait(ragdolltime) | |
632 | if not ragdoll:findFirstChild("Torso") then | |
633 | return | |
634 | end | |
635 | limbclone.Parent = ragdoll.Torso | |
636 | limbclone.Part0 = ragdoll.Torso | |
637 | limbclone.Part1 = ragdoll["Right Leg"] | |
638 | end)() | |
639 | end | |
640 | wait(ragdolltime) | |
641 | glue:destroy() | |
642 | limbcollider:destroy() | |
643 | limbcolliderweld:destroy() | |
644 | end)() | |
645 | end | |
646 | end)() | |
647 | end | |
648 | end | |
649 | - | rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.sin(-i/4)*1.8,0,math.rad(30)+math.sin(-i/4)) * CFrame.new(0,-0.5,0), 0.2) |
649 | + | |
650 | if owner ~= nil and character ~= nil and canattack then | |
651 | cananimate = false | |
652 | canattack = false | |
653 | local rightarmweld = character.Torso:findFirstChild("RightArmWeldknif") | |
654 | local leftarmweld = character.Torso:findFirstChild("LeftArmWeldknif") | |
655 | local headweld = character.Torso:findFirstChild("HeadWeldknif") | |
656 | local rootweld = character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldknif") | |
657 | swooshsound:Play() | |
658 | swooshsound.PlaybackSpeed = 1+(math.random(-4,4)/20) | |
659 | trail.Enabled = true | |
660 | if swingnum == 0 then | |
661 | swingnum = 1 | |
662 | for i = 1,21 do | |
663 | damage() | |
664 | headweld.C0 = headweld.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,math.sin(i/4)*2,0) * CFrame.new(0,0.5,0),0.2) | |
665 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0) * CFrame.fromEulerAnglesXYZ(math.sin(-i/4),0,0),0.2) | |
666 | rootweld.C0 = rootweld.C0:lerp(CFrame.fromEulerAnglesXYZ(math.sin(i/4)/15,math.sin(-i/4)*2,0), 0.2) | |
667 | leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.sin(i/4)*0.6,0,math.sin(i/4)/1.5) * CFrame.new(0,-0.5,0), 0.2) | |
668 | rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.sin(-i/4)*5,0,math.rad(30)+math.sin(-i/4)) * CFrame.new(0,-0.5,0), 0.2) | |
669 | step:wait() | |
670 | end | |
671 | spawn(spinanimation) | |
672 | elseif swingnum == 1 then | |
673 | swingnum = 2 | |
674 | local howup = 0 | |
675 | for i = 1,21 do | |
676 | howup = howup + 1 | |
677 | damage() | |
678 | headweld.C0 = headweld.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,math.sin(i/4)*2.5,0) * CFrame.new(0,0.5,0),0.2) | |
679 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0) * CFrame.fromEulerAnglesXYZ(math.sin(-i/4),0,0),0.2) | |
680 | rootweld.C0 = rootweld.C0:lerp(CFrame.fromEulerAnglesXYZ(math.sin(i/4)/15,math.sin(-i/4)*2.5,0), 0.2) | |
681 | leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(0,0,-math.pi/4) * CFrame.new(0,-0.5,0), 0.2) | |
682 | rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.5-(howup/30),0.5,-(howup/15)) * CFrame.fromEulerAnglesXYZ(0,-math.pi+howup/6,-math.pi/3-(howup/30)) * CFrame.new(0,-0.5,0), 0.2) | |
683 | step:wait() | |
684 | end | |
685 | damage() | |
686 | spawn(spinanimation) | |
687 | elseif swingnum == 2 then | |
688 | swingnum = 0 | |
689 | for i = 1,21 do | |
690 | damage() | |
691 | headweld.C0 = headweld.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,math.sin(i/3)/2,0) * CFrame.new(0,0.5,0),0.2) | |
692 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0) * CFrame.fromEulerAnglesXYZ(math.pi,0,0),0.2) | |
693 | rootweld.C0 = rootweld.C0:lerp(CFrame.fromEulerAnglesXYZ(math.sin(i/3)/10,math.sin(-i/3)/2,0), 0.2) | |
694 | leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.sin(i/3.5)*2,0,0) * CFrame.new(0,-0.7,0), 0.2) | |
695 | rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.sin(i/3.5)*2+math.pi,0,0) * CFrame.new(0,-1,0), 0.2) | |
696 | step:wait() | |
697 | end | |
698 | trail.Enabled = false | |
699 | end | |
700 | if equipped then | |
701 | cananimate = true | |
702 | end | |
703 | if not pressed then | |
704 | canattack = true | |
705 | else | |
706 | canthrow = true | |
707 | cananimate = false | |
708 | local throwsine = 0 | |
709 | while pressed and equipped and not cananimate and step:wait() do | |
710 | throwsine = throwsine + 1 | |
711 | headweld.C0 = headweld.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,math.pi/3+math.sin(throwsine/20)/40,0) * CFrame.new(0,0.5,0),0.2) | |
712 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0) * CFrame.fromEulerAnglesXYZ(-math.rad(30),0,0),0.2) | |
713 | rootweld.C0 = rootweld.C0:lerp(CFrame.fromEulerAnglesXYZ(math.sin(throwsine/20)/40,-math.pi/3+math.sin(-throwsine/20)/40,0), 0.2) | |
714 | leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(40)+math.sin(throwsine/20)/15,0,0) * CFrame.new(0,-0.5,0), 0.2) | |
715 | rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.sin(throwsine/20)/20+math.pi,0,0) * CFrame.new(0,-0.7,0), 0.2) | |
716 | end | |
717 | if not equipped then | |
718 | handle.Transparency = 0 | |
719 | throwpos = nil | |
720 | cananimate = true | |
721 | canattack = true | |
722 | return | |
723 | end | |
724 | swooshsound.PlaybackSpeed = 1+(math.random(-1,4)/10) | |
725 | swooshsound:Play() | |
726 | for i = 1,5 do | |
727 | headweld.C0 = headweld.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,-math.pi/3,0) * CFrame.new(0,0.5,0),0.2) | |
728 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0) * CFrame.fromEulerAnglesXYZ(-math.rad(30),0,0),0.2) | |
729 | rootweld.C0 = rootweld.C0:lerp(CFrame.fromEulerAnglesXYZ(-math.rad(10),math.pi/3,0), 0.2) | |
730 | - | local throwtime = 500 |
730 | + | |
731 | rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(10),0,0) * CFrame.new(0,-0.5,0), 0.2) | |
732 | step:wait() | |
733 | end | |
734 | - | throwtime = throwtime - 1 |
734 | + | |
735 | local knifeclone = Instance.new("Part", character.Head) | |
736 | knifeclone.Size = Vector3.new(0.15, 1.9, 0.7) | |
737 | knifeclone.CanCollide = false | |
738 | knifeclone.Anchored = true | |
739 | knifeclone.Name = "ThrowKnife" | |
740 | knifeclone.CFrame = CFrame.new(handle.Position, throwpos) | |
741 | local mesh = Instance.new("SpecialMesh", knifeclone) | |
742 | mesh.TextureId = handle:findFirstChildOfClass("SpecialMesh").TextureId | |
743 | mesh.MeshId = "http://www.roblox.com/asset/?id=121944778" | |
744 | mesh.Scale = Vector3.new(0.7,0.7,0.7) | |
745 | coroutine.wrap(function() | |
746 | local rotatevalue = 0 | |
747 | local rayhit = false | |
748 | local lastpos = nil | |
749 | local throwtime = 1000 | |
750 | local gravitypower = 0 | |
751 | local lasttorsopos = character.Torso.CFrame | |
752 | while step:wait() and not rayhit do | |
753 | throwtime = throwtime - 0.0001 | |
754 | if throwtime == 0 then | |
755 | knifeclone:Destroy() | |
756 | break | |
757 | end | |
758 | if rotatevalue >= 360 then | |
759 | rotatevalue = 0 | |
760 | end | |
761 | knifeclone.CFrame = knifeclone.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(rotatevalue),0,0) | |
762 | rotatevalue = rotatevalue + 20 | |
763 | local ignorelist = {handle, knifeclone, character} | |
764 | for q,w in pairs(workspace:GetDescendants()) do | |
765 | if w.Name == "ThrowKnife" then | |
766 | table.insert(ignorelist, w) | |
767 | end | |
768 | end | |
769 | local ray = Ray.new(knifeclone.Position, knifeclone.CFrame.lookVector*3) | |
770 | local ray1 = Ray.new(knifeclone.Position, knifeclone.CFrame.upVector*((-0.25)+(-gravitypower))) | |
771 | local hitt, pos = workspace:FindPartOnRayWithIgnoreList(ray, ignorelist) | |
772 | local hitt1, pos1 = workspace:FindPartOnRayWithIgnoreList(ray1, ignorelist) | |
773 | if hitt then | |
774 | --if hitt.Name ~= "ThrowKnife" then | |
775 | - | hitsound.PlaybackSpeed = 3.2+(math.random(-1,4)/10) |
775 | + | |
776 | knifeclone.CFrame = CFrame.new(pos) | |
777 | if lastpos ~= nil then | |
778 | knifeclone.CFrame = CFrame.new(knifeclone.Position, lastpos.p) | |
779 | else | |
780 | knifeclone.CFrame = CFrame.new(knifeclone.Position, lasttorsopos.p) | |
781 | end | |
782 | knifeclone.CFrame = knifeclone.CFrame * CFrame.fromEulerAnglesXYZ(-math.pi/2,0,math.pi) | |
783 | local weldknife = Instance.new("Weld", knifeclone) | |
784 | weldknife.C0 = hitt.CFrame:toObjectSpace(knifeclone.CFrame) | |
785 | - | stabsound.PlaybackSpeed = 1+(math.random(-1,4)/10) |
785 | + | |
786 | weldknife.Name = "ouch_weld" | |
787 | weldknife.Part1 = knifeclone | |
788 | knifeclone.Anchored = false | |
789 | local hithumanoid = false | |
790 | coroutine.wrap(function() | |
791 | knifeclone.Parent = hitt | |
792 | wait() | |
793 | - | local dmg = math.random(50,100) |
793 | + | |
794 | hitsound.PlaybackSpeed = 500+(math.random(-100,400)/1000) | |
795 | hitsound:Play() | |
796 | wait(hitsound.TimeLength) | |
797 | hitsound.Parent = handle | |
798 | end)() | |
799 | if hitt.Parent:findFirstChildOfClass("Humanoid") then | |
800 | hithumanoid = true | |
801 | coroutine.wrap(function() | |
802 | wait() | |
803 | stabsound.Parent = knifeclone | |
804 | stabsound.PlaybackSpeed = 500+(math.random(-100,400)/1000) | |
805 | stabsound:Play() | |
806 | wait(stabsound.TimeLength) | |
807 | stabsound.Parent = handle | |
808 | end)() | |
809 | funnyeffect(hitt.CFrame, hitt) | |
810 | ragdollplr(hitt.Parent) | |
811 | if knifeeffect ~= "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
812 | local dmg = math.random(10000000,10000000) | |
813 | if hitt.Parent ~= nil then | |
814 | if hitt.Parent:findFirstChildOfClass("Humanoid").Health <= dmg then | |
815 | hitt.Parent:findFirstChildOfClass("Humanoid").Health = 0 | |
816 | ragdollkill(hitt.Parent) | |
817 | else | |
818 | - | local dmg = math.random(50,100) |
818 | + | |
819 | - | if hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health <= dmg then |
819 | + | |
820 | end | |
821 | end | |
822 | elseif hitt.Parent.ClassName == "Accessory" or hitt.Parent.ClassName == "Hat" then | |
823 | if hitt.Parent.Parent:findFirstChildOfClass("Humanoid") then | |
824 | hithumanoid = true | |
825 | coroutine.wrap(function() | |
826 | wait() | |
827 | stabsound.Parent = knifeclone | |
828 | stabsound.PlaybackSpeed = 1+(math.random(-1,4)/10) | |
829 | stabsound:Play() | |
830 | wait(stabsound.TimeLength) | |
831 | stabsound.Parent = handle | |
832 | end)() | |
833 | funnyeffect(hitt.CFrame, hitt) | |
834 | ragdollplr(hitt.Parent.Parent) | |
835 | if knifeeffect ~= "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
836 | if hitt.Parent ~= nil then | |
837 | local dmg = math.random(10000000,10000000) | |
838 | if | |
839 | hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health <= dmg then | |
840 | hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health = 0 | |
841 | ragdollkill(hitt.Parent.Parent) | |
842 | else | |
843 | hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health = hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health - dmg | |
844 | end | |
845 | end | |
846 | end | |
847 | end | |
848 | end | |
849 | if not hithumanoid then | |
850 | - | hitsound.PlaybackSpeed = 3.2+(math.random(-1,4)/10) |
850 | + | |
851 | end | |
852 | --end | |
853 | elseif hitt1 then | |
854 | --if hitt1.Name ~= "ThrowKnife" then | |
855 | rayhit = true | |
856 | knifeclone.CFrame = CFrame.new(pos1) | |
857 | knifeclone.CFrame = CFrame.new(knifeclone.Position, lasttorsopos.p) | |
858 | knifeclone.CFrame = knifeclone.CFrame * CFrame.fromEulerAnglesXYZ(math.pi/1.5,math.pi,0) | |
859 | local weldknife = Instance.new("Weld", knifeclone) | |
860 | - | stabsound.PlaybackSpeed = 1+(math.random(-1,4)/10) |
860 | + | |
861 | weldknife.Part0 = hitt1 | |
862 | weldknife.Name = "ouch_weld" | |
863 | weldknife.Part1 = knifeclone | |
864 | knifeclone.Anchored = false | |
865 | local hithumanoid = false | |
866 | coroutine.wrap(function() | |
867 | knifeclone.Parent = hitt1 | |
868 | wait() | |
869 | - | local dmg = math.random(50,100) |
869 | + | |
870 | hitsound.PlaybackSpeed = 500+(math.random(-100,400)/1000) | |
871 | hitsound:Play() | |
872 | wait(hitsound.TimeLength) | |
873 | hitsound.Parent = handle | |
874 | end)() | |
875 | if hitt1.Parent:findFirstChildOfClass("Humanoid") then | |
876 | hithumanoid = true | |
877 | coroutine.wrap(function() | |
878 | wait() | |
879 | stabsound.Parent = knifeclone | |
880 | stabsound.PlaybackSpeed = 500+(math.random(-100,400)/1000) | |
881 | stabsound:Play() | |
882 | wait(stabsound.TimeLength) | |
883 | stabsound.Parent = handle | |
884 | end)() | |
885 | funnyeffect(hitt1.CFrame, hitt1) | |
886 | ragdollplr(hitt1.Parent) | |
887 | if knifeeffect ~= "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
888 | if hitt1.Parent ~= nil then | |
889 | local dmg = math.random(10000000,10000000) | |
890 | if hitt1.Parent:findFirstChildOfClass("Humanoid").Health <= dmg then | |
891 | hitt1.Parent:findFirstChildOfClass("Humanoid").Health = 0 | |
892 | ragdollkill(hitt1.Parent) | |
893 | - | local dmg = math.random(50,100) |
893 | + | |
894 | hitt1.Parent:findFirstChildOfClass("Humanoid").Health = hitt1.Parent:findFirstChildOfClass("Humanoid").Health - dmg | |
895 | end | |
896 | end | |
897 | end | |
898 | elseif hitt1.Parent.ClassName == "Accessory" or hitt1.Parent.ClassName == "Hat" then | |
899 | if hitt1.Parent.Parent:findFirstChildOfClass("Humanoid") then | |
900 | hithumanoid = true | |
901 | coroutine.wrap(function() | |
902 | wait() | |
903 | stabsound.Parent = knifeclone | |
904 | stabsound.PlaybackSpeed = 1+(math.random(-1,4)/10) | |
905 | stabsound:Play() | |
906 | wait(stabsound.TimeLength) | |
907 | stabsound.Parent = handle | |
908 | end)() | |
909 | funnyeffect(hitt1.CFrame, hitt1) | |
910 | - | gravitypower = gravitypower + 0.015 |
910 | + | |
911 | if knifeeffect ~= "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
912 | if hitt1.Parent ~= nil then | |
913 | local dmg = math.random(10000000,10000000) | |
914 | if hitt1.Parent.Parent:findFirstChildOfClass("Humanoid").Health <= dmg then | |
915 | hitt1.Parent.Parent:findFirstChildOfClass("Humanoid").Health = 0 | |
916 | ragdollkill(hitt1.Parent.Parent) | |
917 | else | |
918 | hitt1.Parent.Parent:findFirstChildOfClass("Humanoid").Health = hitt1.Parent.Parent:findFirstChildOfClass("Humanoid").Health - dmg | |
919 | end | |
920 | end | |
921 | end | |
922 | end | |
923 | end | |
924 | if not hithumanoid then | |
925 | game.Debris:AddItem(knifeclone, 30) | |
926 | end | |
927 | --end | |
928 | end | |
929 | if not rayhit then | |
930 | gravitypower = gravitypower + 0 | |
931 | knifeclone.CFrame = knifeclone.CFrame * CFrame.new(0,-gravitypower,-3) | |
932 | lastpos = knifeclone.CFrame | |
933 | knifeclone.CFrame = knifeclone.CFrame * CFrame.fromEulerAnglesXYZ(-math.rad(rotatevalue),0,0) | |
934 | end | |
935 | end | |
936 | end)() | |
937 | for i = 1,15 do | |
938 | headweld.C0 = headweld.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,-math.pi/3,0) * CFrame.new(0,0.5,0),0.2) | |
939 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0) * CFrame.fromEulerAnglesXYZ(-math.rad(30),0,0),0.2) | |
940 | rootweld.C0 = rootweld.C0:lerp(CFrame.fromEulerAnglesXYZ(-math.rad(10),math.pi/3,0), 0.2) | |
941 | leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(-40),0,0) * CFrame.new(0,-0.5,0), 0.2) | |
942 | rightarmweld.C0 = rightarmweld.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(10),0,0) * CFrame.new(0,-0.5,0), 0.2) | |
943 | step:wait() | |
944 | end | |
945 | handle.Transparency = 0 | |
946 | throwpos = nil | |
947 | cananimate = true | |
948 | canattack = true | |
949 | end | |
950 | end | |
951 | end) | |
952 | tool.Equipped:connect(function() | |
953 | equipped = true | |
954 | owner = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent) | |
955 | character = owner.Character | |
956 | cananimate = true | |
957 | local sine = 0 | |
958 | equipsound:Play() | |
959 | tool.Grip = CFrame.new(0,-0.85,0) | |
960 | if character:findFirstChild("KnifeBack") then | |
961 | character:findFirstChild("KnifeBack").Transparency = 1 | |
962 | end | |
963 | local rightarm = Instance.new("Weld", character.Torso) | |
964 | rightarm.Part0 = character.Torso | |
965 | rightarm.Part1 = character["Right Arm"] | |
966 | rightarm.C0 = CFrame.new(1.5,0,0) | |
967 | rightarm.Name = "RightArmWeldknif" | |
968 | local leftarm = Instance.new("Weld", character.Torso) | |
969 | leftarm.Part0 = character.Torso | |
970 | leftarm.Part1 = character["Left Arm"] | |
971 | leftarm.C0 = CFrame.new(-1.5,0,0) | |
972 | leftarm.Name = "LeftArmWeldknif" | |
973 | local head = Instance.new("Weld", character.Torso) | |
974 | head.Part0 = character.Torso | |
975 | head.Part1 = character.Head | |
976 | head.C0 = CFrame.new(0,1.5,0) | |
977 | head.Name = "HeadWeldknif" | |
978 | local humanoidrootpart = Instance.new("Weld", character.HumanoidRootPart) | |
979 | humanoidrootpart.Part0 = character.HumanoidRootPart | |
980 | humanoidrootpart.Part1 = character.Torso | |
981 | humanoidrootpart.Name = "HumanoidRootPartWeldknif" | |
982 | coroutine.wrap(function() | |
983 | while step:wait() do | |
984 | if cananimate then | |
985 | sine = sine + 1 | |
986 | head.C0 = head.C0:lerp(CFrame.new(0,1.5,0),0.1) | |
987 | if not spinning then | |
988 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0),0.1) | |
989 | end | |
990 | humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(),0.1) | |
991 | leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi/2.7 + math.rad(1.5*math.sin(sine/40)),math.pi/-3 + math.rad(1.5*-math.cos(sine/80)),0) * CFrame.new(0,-0.5,0),0.1) | |
992 | rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi/2.7 + math.rad(1.5*math.sin(sine/40)),math.pi/3 + math.rad(1.5*math.cos(sine/80)),0) * CFrame.new(0,-0.5,0),0.1) | |
993 | end | |
994 | end | |
995 | end)() | |
996 | end) | |
997 | tool.Unequipped:connect(function() | |
998 | equipped = false | |
999 | cananimate = false | |
1000 | canthrow = false | |
1001 | unequipsound:Play() | |
1002 | if character.Torso:findFirstChild("LeftArmWeldknif") then | |
1003 | character.Torso:findFirstChild("LeftArmWeldknif"):destroy() | |
1004 | end | |
1005 | if character.Torso:findFirstChild("RightArmWeldknif") then | |
1006 | character.Torso:findFirstChild("RightArmWeldknif"):destroy() | |
1007 | end | |
1008 | if character.Torso:findFirstChild("HeadWeldknif") then | |
1009 | character.Torso:findFirstChild("HeadWeldknif"):destroy() | |
1010 | end | |
1011 | if character:findFirstChild("HumanoidRootPart") then | |
1012 | if character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldknif") then | |
1013 | character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldknif"):destroy() | |
1014 | end | |
1015 | end | |
1016 | if not character:findFirstChild("KnifeBack") then | |
1017 | local clone = handle:Clone() | |
1018 | clone:BreakJoints() | |
1019 | for i,v in pairs(clone:GetDescendants()) do | |
1020 | if v.ClassName ~= "SpecialMesh" and v.ClassName ~= "TouchTransmitter" then | |
1021 | v:destroy() | |
1022 | end | |
1023 | end | |
1024 | local weld = Instance.new("Weld", clone) | |
1025 | weld.Part0 = character.Torso | |
1026 | weld.Part1 = clone | |
1027 | weld.C0 = CFrame.new(1,-1,0) | |
1028 | weld.C0 = weld.C0 * CFrame.fromEulerAnglesXYZ(math.pi-(math.pi/3),0,0) | |
1029 | clone.Parent = character | |
1030 | clone.Name = "KnifeBack" | |
1031 | else | |
1032 | character:findFirstChild("KnifeBack").Transparency = 0 | |
1033 | end | |
1034 | character.KnifeBack:findFirstChildOfClass("SpecialMesh").TextureId = handle:findFirstChildOfClass("SpecialMesh").TextureId | |
1035 | end) | |
1036 | function ragdollkill(character) | |
1037 | local victimshumanoid = character:findFirstChildOfClass("Humanoid") | |
1038 | local checkragd = character:findFirstChild("ragded") | |
1039 | if not checkragd then | |
1040 | local boolvalue = Instance.new("BoolValue", character) | |
1041 | boolvalue.Name = "ragded" | |
1042 | if not character:findFirstChild("UpperTorso") then | |
1043 | character.Archivable = true | |
1044 | for i,v in pairs(character:GetChildren()) do | |
1045 | if v.ClassName == "Sound" then | |
1046 | v:remove() | |
1047 | end | |
1048 | for q,w in pairs(v:GetChildren()) do | |
1049 | if w.ClassName == "Sound" then | |
1050 | w:remove() | |
1051 | end | |
1052 | end | |
1053 | end | |
1054 | local ragdoll = character:Clone() | |
1055 | for i,v in pairs(ragdoll:GetDescendants()) do | |
1056 | if v.ClassName == "Motor" or v.ClassName == "Motor6D" then | |
1057 | v:destroy() | |
1058 | end | |
1059 | end | |
1060 | ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false | |
1061 | ragdoll:findFirstChildOfClass("Humanoid").Health = 0 | |
1062 | if ragdoll:findFirstChild("Health") then | |
1063 | if ragdoll:findFirstChild("Health").ClassName == "Script" then | |
1064 | ragdoll:findFirstChild("Health").Disabled = true | |
1065 | end | |
1066 | end | |
1067 | for i,v in pairs(character:GetChildren()) do | |
1068 | if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" then | |
1069 | v:destroy() | |
1070 | end | |
1071 | end | |
1072 | for i,v in pairs(character:GetChildren()) do | |
1073 | if v.ClassName == "Accessory" then | |
1074 | local attachment1 = v.Handle:findFirstChildOfClass("Attachment") | |
1075 | if attachment1 then | |
1076 | for q,w in pairs(character:GetChildren()) do | |
1077 | if w.ClassName == "Part" then | |
1078 | local attachment2 = w:findFirstChild(attachment1.Name) | |
1079 | if attachment2 then | |
1080 | local hinge = Instance.new("HingeConstraint", v.Handle) | |
1081 | hinge.Attachment0 = attachment1 | |
1082 | hinge.Attachment1 = attachment2 | |
1083 | hinge.LimitsEnabled = true | |
1084 | hinge.LowerAngle = 0 | |
1085 | hinge.UpperAngle = 0 | |
1086 | end | |
1087 | end | |
1088 | end | |
1089 | end | |
1090 | end | |
1091 | end | |
1092 | ragdoll.Parent = workspace | |
1093 | if ragdoll:findFirstChild("Right Arm") then | |
1094 | local glue = Instance.new("Glue", ragdoll.Torso) | |
1095 | glue.Part0 = ragdoll.Torso | |
1096 | glue.Part1 = ragdoll:findFirstChild("Right Arm") | |
1097 | glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
1098 | glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
1099 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm")) | |
1100 | limbcollider.Size = Vector3.new(1.4,1,1) | |
1101 | limbcollider.Shape = "Cylinder" | |
1102 | limbcollider.Transparency = 1 | |
1103 | limbcollider.Name = "LimbCollider" | |
1104 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1105 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm") | |
1106 | limbcolliderweld.Part1 = limbcollider | |
1107 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
1108 | end | |
1109 | if ragdoll:findFirstChild("Left Arm") then | |
1110 | local glue = Instance.new("Glue", ragdoll.Torso) | |
1111 | glue.Part0 = ragdoll.Torso | |
1112 | glue.Part1 = ragdoll:findFirstChild("Left Arm") | |
1113 | glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
1114 | glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
1115 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm")) | |
1116 | limbcollider.Size = Vector3.new(1.4,1,1) | |
1117 | limbcollider.Shape = "Cylinder" | |
1118 | limbcollider.Name = "LimbCollider" | |
1119 | limbcollider.Transparency = 1 | |
1120 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1121 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm") | |
1122 | limbcolliderweld.Part1 = limbcollider | |
1123 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
1124 | end | |
1125 | if ragdoll:findFirstChild("Left Leg") then | |
1126 | local glue = Instance.new("Glue", ragdoll.Torso) | |
1127 | glue.Part0 = ragdoll.Torso | |
1128 | glue.Part1 = ragdoll:findFirstChild("Left Leg") | |
1129 | glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
1130 | glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
1131 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg")) | |
1132 | limbcollider.Size = Vector3.new(1.4,1,1) | |
1133 | limbcollider.Shape = "Cylinder" | |
1134 | limbcollider.Name = "LimbCollider" | |
1135 | limbcollider.Transparency = 1 | |
1136 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1137 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg") | |
1138 | limbcolliderweld.Part1 = limbcollider | |
1139 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
1140 | end | |
1141 | if ragdoll:findFirstChild("Right Leg") then | |
1142 | local glue = Instance.new("Glue", ragdoll.Torso) | |
1143 | glue.Part0 = ragdoll.Torso | |
1144 | glue.Part1 = ragdoll:findFirstChild("Right Leg") | |
1145 | glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
1146 | glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
1147 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg")) | |
1148 | limbcollider.Size = Vector3.new(1.4,1,1) | |
1149 | limbcollider.Shape = "Cylinder" | |
1150 | limbcollider.Name = "LimbCollider" | |
1151 | limbcollider.Transparency = 1 | |
1152 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1153 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg") | |
1154 | limbcolliderweld.Part1 = limbcollider | |
1155 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
1156 | end | |
1157 | if ragdoll:findFirstChild("Head") and ragdoll.Torso:findFirstChild("NeckAttachment") then | |
1158 | local HeadAttachment = Instance.new("Attachment", ragdoll["Head"]) | |
1159 | HeadAttachment.Position = Vector3.new(0, -0.5, 0) | |
1160 | local connection = Instance.new('HingeConstraint', ragdoll["Head"]) | |
1161 | connection.LimitsEnabled = true | |
1162 | connection.Attachment0 = ragdoll.Torso.NeckAttachment | |
1163 | connection.Attachment1 = HeadAttachment | |
1164 | connection.UpperAngle = 60 | |
1165 | connection.LowerAngle = -60 | |
1166 | elseif ragdoll:findFirstChild("Head") and not ragdoll.Torso:findFirstChild("NeckAttachment") then | |
1167 | local hedweld = Instance.new("Weld", ragdoll.Torso) | |
1168 | hedweld.Part0 = ragdoll.Torso | |
1169 | hedweld.Part1 = ragdoll.Head | |
1170 | hedweld.C0 = CFrame.new(0,1.5,0) | |
1171 | end | |
1172 | game.Debris:AddItem(ragdoll, 30) | |
1173 | local function aaaalol() | |
1174 | wait(0.2) | |
1175 | local function searchforvelocity(wot) | |
1176 | for i,v in pairs(wot:GetChildren()) do | |
1177 | searchforvelocity(v) | |
1178 | if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then | |
1179 | v:destroy() | |
1180 | end | |
1181 | end | |
1182 | end | |
1183 | searchforvelocity(ragdoll) | |
1184 | wait(0.5) | |
1185 | if ragdoll:findFirstChildOfClass("Humanoid") then | |
1186 | ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true | |
1187 | end | |
1188 | if ragdoll:findFirstChild("HumanoidRootPart") then | |
1189 | ragdoll:findFirstChild("HumanoidRootPart"):destroy() | |
1190 | end | |
1191 | end | |
1192 | spawn(aaaalol) | |
1193 | elseif character:findFirstChild("UpperTorso") then | |
1194 | character.Archivable = true | |
1195 | for i,v in pairs(character:GetChildren()) do | |
1196 | if v.ClassName == "Sound" then | |
1197 | v:remove() | |
1198 | end | |
1199 | for q,w in pairs(v:GetChildren()) do | |
1200 | if w.ClassName == "Sound" then | |
1201 | w:remove() | |
1202 | end | |
1203 | end | |
1204 | end | |
1205 | local ragdoll = character:Clone() | |
1206 | ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false | |
1207 | for i,v in pairs(ragdoll:GetDescendants()) do | |
1208 | if v.ClassName == "Motor" or v.ClassName == "Motor6D" then | |
1209 | v:destroy() | |
1210 | end | |
1211 | end | |
1212 | ragdoll:BreakJoints() | |
1213 | ragdoll:findFirstChildOfClass("Humanoid").Health = 0 | |
1214 | if ragdoll:findFirstChild("Health") then | |
1215 | if ragdoll:findFirstChild("Health").ClassName == "Script" then | |
1216 | ragdoll:findFirstChild("Health").Disabled = true | |
1217 | end | |
1218 | end | |
1219 | for i,v in pairs(character:GetChildren()) do | |
1220 | if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" or v.ClassName == "MeshPart" then | |
1221 | v:destroy() | |
1222 | end | |
1223 | end | |
1224 | for i,v in pairs(character:GetChildren()) do | |
1225 | if v.ClassName == "Accessory" then | |
1226 | local attachment1 = v.Handle:findFirstChildOfClass("Attachment") | |
1227 | if attachment1 then | |
1228 | for q,w in pairs(character:GetChildren()) do | |
1229 | if w.ClassName == "Part" or w.ClassName == "MeshPart" then | |
1230 | local attachment2 = w:findFirstChild(attachment1.Name) | |
1231 | if attachment2 then | |
1232 | local hinge = Instance.new("HingeConstraint", v.Handle) | |
1233 | hinge.Attachment0 = attachment1 | |
1234 | hinge.Attachment1 = attachment2 | |
1235 | hinge.LimitsEnabled = true | |
1236 | hinge.LowerAngle = 0 | |
1237 | hinge.UpperAngle = 0 | |
1238 | end | |
1239 | end | |
1240 | end | |
1241 | end | |
1242 | end | |
1243 | end | |
1244 | ragdoll.Parent = workspace | |
1245 | local Humanoid = ragdoll:findFirstChildOfClass("Humanoid") | |
1246 | Humanoid.PlatformStand = true | |
1247 | local function makeballconnections(limb, attachementone, attachmenttwo, twistlower, twistupper) | |
1248 | local connection = Instance.new('BallSocketConstraint', limb) | |
1249 | connection.LimitsEnabled = true | |
1250 | connection.Attachment0 = attachementone | |
1251 | connection.Attachment1 = attachmenttwo | |
1252 | connection.TwistLimitsEnabled = true | |
1253 | connection.TwistLowerAngle = twistlower | |
1254 | connection.TwistUpperAngle = twistupper | |
1255 | local limbcollider = Instance.new("Part", limb) | |
1256 | limbcollider.Size = Vector3.new(0.1,1,1) | |
1257 | limbcollider.Shape = "Cylinder" | |
1258 | limbcollider.Transparency = 1 | |
1259 | limbcollider:BreakJoints() | |
1260 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1261 | limbcolliderweld.Part0 = limb | |
1262 | limbcolliderweld.Part1 = limbcollider | |
1263 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) | |
1264 | end | |
1265 | local function makehingeconnections(limb, attachementone, attachmenttwo, lower, upper) | |
1266 | local connection = Instance.new('HingeConstraint', limb) | |
1267 | connection.LimitsEnabled = true | |
1268 | connection.Attachment0 = attachementone | |
1269 | connection.Attachment1 = attachmenttwo | |
1270 | connection.LimitsEnabled = true | |
1271 | connection.LowerAngle = lower | |
1272 | connection.UpperAngle = upper | |
1273 | local limbcollider = Instance.new("Part", limb) | |
1274 | limbcollider.Size = Vector3.new(0.1,1,1) | |
1275 | limbcollider.Shape = "Cylinder" | |
1276 | limbcollider.Transparency = 1 | |
1277 | limbcollider:BreakJoints() | |
1278 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1279 | limbcolliderweld.Part0 = limb | |
1280 | limbcolliderweld.Part1 = limbcollider | |
1281 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) | |
1282 | end | |
1283 | local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head) | |
1284 | HeadAttachment.Position = Vector3.new(0, -0.5, 0) | |
1285 | if ragdoll.UpperTorso:findFirstChild("NeckAttachment") then | |
1286 | makehingeconnections(Humanoid.Parent.Head, HeadAttachment, ragdoll.UpperTorso.NeckAttachment, -50, 50) | |
1287 | end | |
1288 | makehingeconnections(Humanoid.Parent.LowerTorso, Humanoid.Parent.LowerTorso.WaistRigAttachment, Humanoid.Parent.UpperTorso.WaistRigAttachment, -50, 50) | |
1289 | makeballconnections(Humanoid.Parent.LeftUpperArm, Humanoid.Parent.LeftUpperArm.LeftShoulderRigAttachment, Humanoid.Parent.UpperTorso.LeftShoulderRigAttachment, -200, 200, 180) | |
1290 | makehingeconnections(Humanoid.Parent.LeftLowerArm, Humanoid.Parent.LeftLowerArm.LeftElbowRigAttachment, Humanoid.Parent.LeftUpperArm.LeftElbowRigAttachment, 0, -60) | |
1291 | makehingeconnections(Humanoid.Parent.LeftHand, Humanoid.Parent.LeftHand.LeftWristRigAttachment, Humanoid.Parent.LeftLowerArm.LeftWristRigAttachment, -20, 20) | |
1292 | -- | |
1293 | makeballconnections(Humanoid.Parent.RightUpperArm, Humanoid.Parent.RightUpperArm.RightShoulderRigAttachment, Humanoid.Parent.UpperTorso.RightShoulderRigAttachment, -200, 200, 180) | |
1294 | makehingeconnections(Humanoid.Parent.RightLowerArm, Humanoid.Parent.RightLowerArm.RightElbowRigAttachment, Humanoid.Parent.RightUpperArm.RightElbowRigAttachment, 0, -60) | |
1295 | makehingeconnections(Humanoid.Parent.RightHand, Humanoid.Parent.RightHand.RightWristRigAttachment, Humanoid.Parent.RightLowerArm.RightWristRigAttachment, -20, 20) | |
1296 | -- | |
1297 | makeballconnections(Humanoid.Parent.RightUpperLeg, Humanoid.Parent.RightUpperLeg.RightHipRigAttachment, Humanoid.Parent.LowerTorso.RightHipRigAttachment, -80, 80, 80) | |
1298 | makehingeconnections(Humanoid.Parent.RightLowerLeg, Humanoid.Parent.RightLowerLeg.RightKneeRigAttachment, Humanoid.Parent.RightUpperLeg.RightKneeRigAttachment, 0, 60) | |
1299 | makehingeconnections(Humanoid.Parent.RightFoot, Humanoid.Parent.RightFoot.RightAnkleRigAttachment, Humanoid.Parent.RightLowerLeg.RightAnkleRigAttachment, -20, 20) | |
1300 | -- | |
1301 | makeballconnections(Humanoid.Parent.LeftUpperLeg, Humanoid.Parent.LeftUpperLeg.LeftHipRigAttachment, Humanoid.Parent.LowerTorso.LeftHipRigAttachment, -80, 80, 80) | |
1302 | makehingeconnections(Humanoid.Parent.LeftLowerLeg, Humanoid.Parent.LeftLowerLeg.LeftKneeRigAttachment, Humanoid.Parent.LeftUpperLeg.LeftKneeRigAttachment, 0, 60) | |
1303 | makehingeconnections(Humanoid.Parent.LeftFoot, Humanoid.Parent.LeftFoot.LeftAnkleRigAttachment, Humanoid.Parent.LeftLowerLeg.LeftAnkleRigAttachment, -20, 20) | |
1304 | for i,v in pairs(Humanoid.Parent:GetChildren()) do | |
1305 | if v.ClassName == "Accessory" then | |
1306 | local attachment1 = v.Handle:findFirstChildOfClass("Attachment") | |
1307 | if attachment1 then | |
1308 | for q,w in pairs(Humanoid.Parent:GetChildren()) do | |
1309 | if w.ClassName == "Part" then | |
1310 | local attachment2 = w:findFirstChild(attachment1.Name) | |
1311 | if attachment2 then | |
1312 | local hinge = Instance.new("HingeConstraint", v.Handle) | |
1313 | hinge.Attachment0 = attachment1 | |
1314 | hinge.Attachment1 = attachment2 | |
1315 | hinge.LimitsEnabled = true | |
1316 | hinge.LowerAngle = 0 | |
1317 | hinge.UpperAngle = 0 | |
1318 | end | |
1319 | end | |
1320 | end | |
1321 | end | |
1322 | end | |
1323 | end | |
1324 | for i,v in pairs(ragdoll:GetChildren()) do | |
1325 | for q,w in pairs(v:GetChildren()) do | |
1326 | if w.ClassName == "Motor6D"--[[ and w.Name ~= "Neck"--]] and w.Name ~= "ouch_weld" then | |
1327 | w:destroy() | |
1328 | end | |
1329 | end | |
1330 | end | |
1331 | if ragdoll:findFirstChild("HumanoidRootPart") then | |
1332 | ragdoll.HumanoidRootPart:destroy() | |
1333 | end | |
1334 | - | end)() |
1334 | + | |
1335 | ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true | |
1336 | end | |
1337 | local function waitfordatmoment() | |
1338 | wait(0.2) | |
1339 | local function searchforvelocity(wot) | |
1340 | for i,v in pairs(wot:GetChildren()) do | |
1341 | searchforvelocity(v) | |
1342 | if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then | |
1343 | v:destroy() | |
1344 | end | |
1345 | end | |
1346 | end | |
1347 | searchforvelocity(ragdoll) | |
1348 | end | |
1349 | spawn(waitfordatmoment) | |
1350 | game.Debris:AddItem(ragdoll, 30) | |
1351 | end | |
1352 | end | |
1353 | end | |
1354 | end)) | |
1355 | LocalScript12.Parent = Tool0 | |
1356 | table.insert(cors,sandbox(LocalScript12,function() | |
1357 | end)) | |
1358 | RemoteEvent13.Name = "knifeevent" | |
1359 | RemoteEvent13.Parent = Tool0 | |
1360 | for i,v in pairs(mas:GetChildren()) do | |
1361 | v.Parent = owner.Character | |
1362 | pcall(function() v:MakeJoints() end) | |
1363 | end | |
1364 | mas:Destroy() | |
1365 | for i,v in pairs(cors) do | |
1366 | spawn(function() | |
1367 | pcall(v) | |
1368 | end) | |
1369 | end | |
1370 | NLS([[ | |
1371 | --By Rufus14 | |
1372 | owner = game:GetService("Players").LocalPlayer | |
1373 | character = owner.Character | |
1374 | tool = script.Parent | |
1375 | event = tool:WaitForChild("knifeevent") | |
1376 | mouse = owner:GetMouse() | |
1377 | equipped = false | |
1378 | tool.Equipped:connect(function() | |
1379 | owner = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent) | |
1380 | character = owner.Character | |
1381 | equipped = true | |
1382 | end) | |
1383 | tool.Unequipped:connect(function() | |
1384 | equipped = false | |
1385 | end) | |
1386 | mouse.KeyDown:connect(function(key) | |
1387 | key = key:lower() | |
1388 | if key == "e" and equipped then | |
1389 | event:FireServer("skin") | |
1390 | end | |
1391 | end) | |
1392 | mouse.Button1Up:connect(function() | |
1393 | event:FireServer("throw", mouse.Hit) | |
1394 | end) | |
1395 | ]], Tool0) |