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 | cananimate = false | |
101 | equipped = false | |
102 | - | canthrow = false |
102 | + | |
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 | event = tool:WaitForChild("knifeevent") | |
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 = 1.5 | |
120 | spinning = false | |
121 | canthrow = true | |
122 | knifeeffect = "default" | |
123 | throwpos = nil | |
124 | pressed = false | |
125 | function spinanimation() | |
126 | local spinvalue = 0 | |
127 | spinning = true | |
128 | swooshsound.PlaybackSpeed = 1+(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 | end | |
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(20,50) | |
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 | limbcollider:destroy() | |
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 | if knifeeffect ~= "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
483 | local dmg = math.random(20,50) | |
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, 0.2) | |
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 | tool.Activated:connect(function() | |
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)*1.8,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 | - | for i = 1,5 do |
707 | + | |
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 = 10,50 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 | handle.Transparency = 1 | |
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 = 1000000 | |
750 | local gravitypower = 0 | |
751 | local lasttorsopos = character.Torso.CFrame | |
752 | while step:wait() and not rayhit do | |
753 | throwtime = throwtime - 1 | |
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 | rayhit = true | |
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 | weldknife.Part0 = hitt | |
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 | hitsound.Parent = knifeclone | |
794 | hitsound.PlaybackSpeed = 3.2+(math.random(-1,4)/10) | |
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 = 1+(math.random(-1,4)/10) | |
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(50,100) | |
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 | hitt.Parent:findFirstChildOfClass("Humanoid").Health = hitt.Parent:findFirstChildOfClass("Humanoid").Health - dmg | |
819 | end | |
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(50,100) | |
838 | if hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health <= dmg then | |
839 | hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health = 0 | |
840 | ragdollkill(hitt.Parent.Parent) | |
841 | else | |
842 | hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health = hitt.Parent.Parent:findFirstChildOfClass("Humanoid").Health - dmg | |
843 | end | |
844 | end | |
845 | end | |
846 | end | |
847 | end | |
848 | if not hithumanoid then | |
849 | game.Debris:AddItem(knifeclone, 30) | |
850 | end | |
851 | --end | |
852 | elseif hitt1 then | |
853 | --if hitt1.Name ~= "ThrowKnife" then | |
854 | rayhit = true | |
855 | knifeclone.CFrame = CFrame.new(pos1) | |
856 | knifeclone.CFrame = CFrame.new(knifeclone.Position, lasttorsopos.p) | |
857 | knifeclone.CFrame = knifeclone.CFrame * CFrame.fromEulerAnglesXYZ(math.pi/1.5,math.pi,0) | |
858 | local weldknife = Instance.new("Weld", knifeclone) | |
859 | weldknife.C0 = hitt1.CFrame:toObjectSpace(knifeclone.CFrame) | |
860 | weldknife.Part0 = hitt1 | |
861 | weldknife.Name = "ouch_weld" | |
862 | weldknife.Part1 = knifeclone | |
863 | knifeclone.Anchored = false | |
864 | local hithumanoid = false | |
865 | coroutine.wrap(function() | |
866 | knifeclone.Parent = hitt1 | |
867 | wait() | |
868 | hitsound.Parent = knifeclone | |
869 | hitsound.PlaybackSpeed = 3.2+(math.random(-1,4)/10) | |
870 | hitsound:Play() | |
871 | wait(hitsound.TimeLength) | |
872 | hitsound.Parent = handle | |
873 | end)() | |
874 | if hitt1.Parent:findFirstChildOfClass("Humanoid") then | |
875 | hithumanoid = true | |
876 | coroutine.wrap(function() | |
877 | wait() | |
878 | stabsound.Parent = knifeclone | |
879 | stabsound.PlaybackSpeed = 1+(math.random(-1,4)/10) | |
880 | stabsound:Play() | |
881 | wait(stabsound.TimeLength) | |
882 | stabsound.Parent = handle | |
883 | end)() | |
884 | funnyeffect(hitt1.CFrame, hitt1) | |
885 | ragdollplr(hitt1.Parent) | |
886 | if knifeeffect ~= "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
887 | if hitt1.Parent ~= nil then | |
888 | local dmg = math.random(50,100) | |
889 | if hitt1.Parent:findFirstChildOfClass("Humanoid").Health <= dmg then | |
890 | hitt1.Parent:findFirstChildOfClass("Humanoid").Health = 0 | |
891 | ragdollkill(hitt1.Parent) | |
892 | else | |
893 | hitt1.Parent:findFirstChildOfClass("Humanoid").Health = hitt1.Parent:findFirstChildOfClass("Humanoid").Health - dmg | |
894 | end | |
895 | end | |
896 | end | |
897 | elseif hitt1.Parent.ClassName == "Accessory" or hitt1.Parent.ClassName == "Hat" then | |
898 | if hitt1.Parent.Parent:findFirstChildOfClass("Humanoid") then | |
899 | hithumanoid = true | |
900 | coroutine.wrap(function() | |
901 | wait() | |
902 | stabsound.Parent = knifeclone | |
903 | stabsound.PlaybackSpeed = 1+(math.random(-1,4)/10) | |
904 | stabsound:Play() | |
905 | wait(stabsound.TimeLength) | |
906 | stabsound.Parent = handle | |
907 | end)() | |
908 | funnyeffect(hitt1.CFrame, hitt1) | |
909 | ragdollplr(hitt1.Parent.Parent) | |
910 | if knifeeffect ~= "64bits32bits16bits8bits4bits2bits1BIT-efgrineegtntrnfenecceimdwmmoc" then | |
911 | if hitt1.Parent ~= nil then | |
912 | local dmg = math.random(50,100) | |
913 | if hitt1.Parent.Parent:findFirstChildOfClass("Humanoid").Health <= dmg then | |
914 | hitt1.Parent.Parent:findFirstChildOfClass("Humanoid").Health = 0 | |
915 | ragdollkill(hitt1.Parent.Parent) | |
916 | else | |
917 | hitt1.Parent.Parent:findFirstChildOfClass("Humanoid").Health = hitt1.Parent.Parent:findFirstChildOfClass("Humanoid").Health - dmg | |
918 | end | |
919 | end | |
920 | end | |
921 | end | |
922 | end | |
923 | if not hithumanoid then | |
924 | game.Debris:AddItem(knifeclone, 30) | |
925 | end | |
926 | --end | |
927 | end | |
928 | if not rayhit then | |
929 | gravitypower = gravitypower + 0.015 | |
930 | knifeclone.CFrame = knifeclone.CFrame * CFrame.new(0,-gravitypower,-3) | |
931 | lastpos = knifeclone.CFrame | |
932 | knifeclone.CFrame = knifeclone.CFrame * CFrame.fromEulerAnglesXYZ(-math.rad(rotatevalue),0,0) | |
933 | end | |
934 | end | |
935 | end)() | |
936 | for i = 1,15 do | |
937 | 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) | |
938 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0) * CFrame.fromEulerAnglesXYZ(-math.rad(30),0,0),0.2) | |
939 | rootweld.C0 = rootweld.C0:lerp(CFrame.fromEulerAnglesXYZ(-math.rad(10),math.pi/3,0), 0.2) | |
940 | 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) | |
941 | 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) | |
942 | step:wait() | |
943 | end | |
944 | handle.Transparency = 0 | |
945 | throwpos = nil | |
946 | cananimate = true | |
947 | canattack = true | |
948 | end | |
949 | end | |
950 | end) | |
951 | tool.Equipped:connect(function() | |
952 | equipped = true | |
953 | owner = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent) | |
954 | character = owner.Character | |
955 | cananimate = true | |
956 | local sine = 0 | |
957 | equipsound:Play() | |
958 | tool.Grip = CFrame.new(0,-0.85,0) | |
959 | if character:findFirstChild("KnifeBack") then | |
960 | character:findFirstChild("KnifeBack").Transparency = 1 | |
961 | end | |
962 | local rightarm = Instance.new("Weld", character.Torso) | |
963 | rightarm.Part0 = character.Torso | |
964 | rightarm.Part1 = character["Right Arm"] | |
965 | rightarm.C0 = CFrame.new(1.5,0,0) | |
966 | rightarm.Name = "RightArmWeldknif" | |
967 | local leftarm = Instance.new("Weld", character.Torso) | |
968 | leftarm.Part0 = character.Torso | |
969 | leftarm.Part1 = character["Left Arm"] | |
970 | leftarm.C0 = CFrame.new(-1.5,0,0) | |
971 | leftarm.Name = "LeftArmWeldknif" | |
972 | local head = Instance.new("Weld", character.Torso) | |
973 | head.Part0 = character.Torso | |
974 | head.Part1 = character.Head | |
975 | head.C0 = CFrame.new(0,1.5,0) | |
976 | head.Name = "HeadWeldknif" | |
977 | local humanoidrootpart = Instance.new("Weld", character.HumanoidRootPart) | |
978 | humanoidrootpart.Part0 = character.HumanoidRootPart | |
979 | humanoidrootpart.Part1 = character.Torso | |
980 | - | canthrow = false |
980 | + | |
981 | coroutine.wrap(function() | |
982 | while step:wait() do | |
983 | if cananimate then | |
984 | sine = sine + 1 | |
985 | head.C0 = head.C0:lerp(CFrame.new(0,1.5,0),0.1) | |
986 | if not spinning then | |
987 | tool.Grip = tool.Grip:lerp(CFrame.new(0,-0.85,0),0.1) | |
988 | end | |
989 | humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(),0.1) | |
990 | 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) | |
991 | 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) | |
992 | end | |
993 | end | |
994 | end)() | |
995 | end) | |
996 | tool.Unequipped:connect(function() | |
997 | equipped = false | |
998 | cananimate = false | |
999 | canthrow = true | |
1000 | unequipsound:Play() | |
1001 | if character.Torso:findFirstChild("LeftArmWeldknif") then | |
1002 | character.Torso:findFirstChild("LeftArmWeldknif"):destroy() | |
1003 | end | |
1004 | if character.Torso:findFirstChild("RightArmWeldknif") then | |
1005 | character.Torso:findFirstChild("RightArmWeldknif"):destroy() | |
1006 | end | |
1007 | if character.Torso:findFirstChild("HeadWeldknif") then | |
1008 | character.Torso:findFirstChild("HeadWeldknif"):destroy() | |
1009 | end | |
1010 | if character:findFirstChild("HumanoidRootPart") then | |
1011 | if character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldknif") then | |
1012 | character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldknif"):destroy() | |
1013 | end | |
1014 | end | |
1015 | if not character:findFirstChild("KnifeBack") then | |
1016 | local clone = handle:Clone() | |
1017 | clone:BreakJoints() | |
1018 | for i,v in pairs(clone:GetDescendants()) do | |
1019 | if v.ClassName ~= "SpecialMesh" and v.ClassName ~= "TouchTransmitter" then | |
1020 | v:destroy() | |
1021 | end | |
1022 | end | |
1023 | local weld = Instance.new("Weld", clone) | |
1024 | weld.Part0 = character.Torso | |
1025 | weld.Part1 = clone | |
1026 | weld.C0 = CFrame.new(1,-1,0) | |
1027 | weld.C0 = weld.C0 * CFrame.fromEulerAnglesXYZ(math.pi-(math.pi/3),0,0) | |
1028 | clone.Parent = character | |
1029 | clone.Name = "KnifeBack" | |
1030 | else | |
1031 | character:findFirstChild("KnifeBack").Transparency = 0 | |
1032 | end | |
1033 | character.KnifeBack:findFirstChildOfClass("SpecialMesh").TextureId = handle:findFirstChildOfClass("SpecialMesh").TextureId | |
1034 | end) | |
1035 | function ragdollkill(character) | |
1036 | local victimshumanoid = character:findFirstChildOfClass("Humanoid") | |
1037 | local checkragd = character:findFirstChild("ragded") | |
1038 | if not checkragd then | |
1039 | local boolvalue = Instance.new("BoolValue", character) | |
1040 | boolvalue.Name = "ragded" | |
1041 | if not character:findFirstChild("UpperTorso") then | |
1042 | character.Archivable = true | |
1043 | for i,v in pairs(character:GetChildren()) do | |
1044 | if v.ClassName == "Sound" then | |
1045 | v:remove() | |
1046 | end | |
1047 | for q,w in pairs(v:GetChildren()) do | |
1048 | if w.ClassName == "Sound" then | |
1049 | w:remove() | |
1050 | end | |
1051 | end | |
1052 | end | |
1053 | local ragdoll = character:Clone() | |
1054 | for i,v in pairs(ragdoll:GetDescendants()) do | |
1055 | if v.ClassName == "Motor" or v.ClassName == "Motor6D" then | |
1056 | v:destroy() | |
1057 | end | |
1058 | end | |
1059 | ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false | |
1060 | ragdoll:findFirstChildOfClass("Humanoid").Health = 0 | |
1061 | if ragdoll:findFirstChild("Health") then | |
1062 | if ragdoll:findFirstChild("Health").ClassName == "Script" then | |
1063 | ragdoll:findFirstChild("Health").Disabled = true | |
1064 | end | |
1065 | end | |
1066 | for i,v in pairs(character:GetChildren()) do | |
1067 | if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" then | |
1068 | v:destroy() | |
1069 | end | |
1070 | end | |
1071 | for i,v in pairs(character:GetChildren()) do | |
1072 | if v.ClassName == "Accessory" then | |
1073 | local attachment1 = v.Handle:findFirstChildOfClass("Attachment") | |
1074 | if attachment1 then | |
1075 | for q,w in pairs(character:GetChildren()) do | |
1076 | if w.ClassName == "Part" then | |
1077 | local attachment2 = w:findFirstChild(attachment1.Name) | |
1078 | if attachment2 then | |
1079 | local hinge = Instance.new("HingeConstraint", v.Handle) | |
1080 | hinge.Attachment0 = attachment1 | |
1081 | hinge.Attachment1 = attachment2 | |
1082 | hinge.LimitsEnabled = true | |
1083 | hinge.LowerAngle = 0 | |
1084 | hinge.UpperAngle = 0 | |
1085 | end | |
1086 | end | |
1087 | end | |
1088 | end | |
1089 | end | |
1090 | end | |
1091 | ragdoll.Parent = workspace | |
1092 | if ragdoll:findFirstChild("Right Arm") then | |
1093 | local glue = Instance.new("Glue", ragdoll.Torso) | |
1094 | glue.Part0 = ragdoll.Torso | |
1095 | glue.Part1 = ragdoll:findFirstChild("Right Arm") | |
1096 | glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
1097 | glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
1098 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Arm")) | |
1099 | limbcollider.Size = Vector3.new(1.4,1,1) | |
1100 | limbcollider.Shape = "Cylinder" | |
1101 | limbcollider.Transparency = 1 | |
1102 | limbcollider.Name = "LimbCollider" | |
1103 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1104 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Arm") | |
1105 | limbcolliderweld.Part1 = limbcollider | |
1106 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
1107 | end | |
1108 | if ragdoll:findFirstChild("Left Arm") then | |
1109 | local glue = Instance.new("Glue", ragdoll.Torso) | |
1110 | glue.Part0 = ragdoll.Torso | |
1111 | glue.Part1 = ragdoll:findFirstChild("Left Arm") | |
1112 | glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
1113 | glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
1114 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Arm")) | |
1115 | limbcollider.Size = Vector3.new(1.4,1,1) | |
1116 | limbcollider.Shape = "Cylinder" | |
1117 | limbcollider.Name = "LimbCollider" | |
1118 | limbcollider.Transparency = 1 | |
1119 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1120 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Arm") | |
1121 | limbcolliderweld.Part1 = limbcollider | |
1122 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
1123 | end | |
1124 | if ragdoll:findFirstChild("Left Leg") then | |
1125 | local glue = Instance.new("Glue", ragdoll.Torso) | |
1126 | glue.Part0 = ragdoll.Torso | |
1127 | glue.Part1 = ragdoll:findFirstChild("Left Leg") | |
1128 | glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
1129 | glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
1130 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Left Leg")) | |
1131 | limbcollider.Size = Vector3.new(1.4,1,1) | |
1132 | limbcollider.Shape = "Cylinder" | |
1133 | limbcollider.Name = "LimbCollider" | |
1134 | limbcollider.Transparency = 1 | |
1135 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1136 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Left Leg") | |
1137 | limbcolliderweld.Part1 = limbcollider | |
1138 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
1139 | end | |
1140 | if ragdoll:findFirstChild("Right Leg") then | |
1141 | local glue = Instance.new("Glue", ragdoll.Torso) | |
1142 | glue.Part0 = ragdoll.Torso | |
1143 | glue.Part1 = ragdoll:findFirstChild("Right Leg") | |
1144 | glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
1145 | glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
1146 | local limbcollider = Instance.new("Part", ragdoll:findFirstChild("Right Leg")) | |
1147 | limbcollider.Size = Vector3.new(1.4,1,1) | |
1148 | limbcollider.Shape = "Cylinder" | |
1149 | limbcollider.Name = "LimbCollider" | |
1150 | limbcollider.Transparency = 1 | |
1151 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1152 | limbcolliderweld.Part0 = ragdoll:findFirstChild("Right Leg") | |
1153 | limbcolliderweld.Part1 = limbcollider | |
1154 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
1155 | end | |
1156 | if ragdoll:findFirstChild("Head") and ragdoll.Torso:findFirstChild("NeckAttachment") then | |
1157 | local HeadAttachment = Instance.new("Attachment", ragdoll["Head"]) | |
1158 | HeadAttachment.Position = Vector3.new(0, -0.5, 0) | |
1159 | local connection = Instance.new('HingeConstraint', ragdoll["Head"]) | |
1160 | connection.LimitsEnabled = true | |
1161 | connection.Attachment0 = ragdoll.Torso.NeckAttachment | |
1162 | connection.Attachment1 = HeadAttachment | |
1163 | connection.UpperAngle = 60 | |
1164 | connection.LowerAngle = -60 | |
1165 | elseif ragdoll:findFirstChild("Head") and not ragdoll.Torso:findFirstChild("NeckAttachment") then | |
1166 | local hedweld = Instance.new("Weld", ragdoll.Torso) | |
1167 | hedweld.Part0 = ragdoll.Torso | |
1168 | hedweld.Part1 = ragdoll.Head | |
1169 | hedweld.C0 = CFrame.new(0,1.5,0) | |
1170 | end | |
1171 | game.Debris:AddItem(ragdoll, 30) | |
1172 | local function aaaalol() | |
1173 | wait(0.2) | |
1174 | local function searchforvelocity(wot) | |
1175 | for i,v in pairs(wot:GetChildren()) do | |
1176 | searchforvelocity(v) | |
1177 | if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then | |
1178 | v:destroy() | |
1179 | end | |
1180 | end | |
1181 | end | |
1182 | searchforvelocity(ragdoll) | |
1183 | wait(0.5) | |
1184 | if ragdoll:findFirstChildOfClass("Humanoid") then | |
1185 | ragdoll:findFirstChildOfClass("Humanoid").PlatformStand = true | |
1186 | end | |
1187 | if ragdoll:findFirstChild("HumanoidRootPart") then | |
1188 | ragdoll:findFirstChild("HumanoidRootPart"):destroy() | |
1189 | end | |
1190 | end | |
1191 | spawn(aaaalol) | |
1192 | elseif character:findFirstChild("UpperTorso") then | |
1193 | character.Archivable = true | |
1194 | for i,v in pairs(character:GetChildren()) do | |
1195 | if v.ClassName == "Sound" then | |
1196 | v:remove() | |
1197 | end | |
1198 | for q,w in pairs(v:GetChildren()) do | |
1199 | if w.ClassName == "Sound" then | |
1200 | w:remove() | |
1201 | end | |
1202 | end | |
1203 | end | |
1204 | local ragdoll = character:Clone() | |
1205 | ragdoll:findFirstChildOfClass("Humanoid").BreakJointsOnDeath = false | |
1206 | for i,v in pairs(ragdoll:GetDescendants()) do | |
1207 | if v.ClassName == "Motor" or v.ClassName == "Motor6D" then | |
1208 | v:destroy() | |
1209 | end | |
1210 | end | |
1211 | ragdoll:BreakJoints() | |
1212 | ragdoll:findFirstChildOfClass("Humanoid").Health = 0 | |
1213 | if ragdoll:findFirstChild("Health") then | |
1214 | if ragdoll:findFirstChild("Health").ClassName == "Script" then | |
1215 | ragdoll:findFirstChild("Health").Disabled = true | |
1216 | end | |
1217 | end | |
1218 | for i,v in pairs(character:GetChildren()) do | |
1219 | if v.ClassName == "Part" or v.ClassName == "ForceField" or v.ClassName == "Accessory" or v.ClassName == "Hat" or v.ClassName == "MeshPart" then | |
1220 | v:destroy() | |
1221 | end | |
1222 | end | |
1223 | for i,v in pairs(character:GetChildren()) do | |
1224 | if v.ClassName == "Accessory" then | |
1225 | local attachment1 = v.Handle:findFirstChildOfClass("Attachment") | |
1226 | if attachment1 then | |
1227 | for q,w in pairs(character:GetChildren()) do | |
1228 | if w.ClassName == "Part" or w.ClassName == "MeshPart" then | |
1229 | local attachment2 = w:findFirstChild(attachment1.Name) | |
1230 | if attachment2 then | |
1231 | local hinge = Instance.new("HingeConstraint", v.Handle) | |
1232 | hinge.Attachment0 = attachment1 | |
1233 | hinge.Attachment1 = attachment2 | |
1234 | hinge.LimitsEnabled = true | |
1235 | hinge.LowerAngle = 0 | |
1236 | hinge.UpperAngle = 0 | |
1237 | end | |
1238 | end | |
1239 | end | |
1240 | end | |
1241 | end | |
1242 | end | |
1243 | ragdoll.Parent = workspace | |
1244 | local Humanoid = ragdoll:findFirstChildOfClass("Humanoid") | |
1245 | Humanoid.PlatformStand = true | |
1246 | local function makeballconnections(limb, attachementone, attachmenttwo, twistlower, twistupper) | |
1247 | local connection = Instance.new('BallSocketConstraint', limb) | |
1248 | connection.LimitsEnabled = true | |
1249 | connection.Attachment0 = attachementone | |
1250 | connection.Attachment1 = attachmenttwo | |
1251 | connection.TwistLimitsEnabled = true | |
1252 | connection.TwistLowerAngle = twistlower | |
1253 | connection.TwistUpperAngle = twistupper | |
1254 | local limbcollider = Instance.new("Part", limb) | |
1255 | limbcollider.Size = Vector3.new(0.1,1,1) | |
1256 | limbcollider.Shape = "Cylinder" | |
1257 | limbcollider.Transparency = 1 | |
1258 | limbcollider:BreakJoints() | |
1259 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1260 | limbcolliderweld.Part0 = limb | |
1261 | limbcolliderweld.Part1 = limbcollider | |
1262 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) | |
1263 | end | |
1264 | local function makehingeconnections(limb, attachementone, attachmenttwo, lower, upper) | |
1265 | local connection = Instance.new('HingeConstraint', limb) | |
1266 | connection.LimitsEnabled = true | |
1267 | connection.Attachment0 = attachementone | |
1268 | connection.Attachment1 = attachmenttwo | |
1269 | connection.LimitsEnabled = true | |
1270 | connection.LowerAngle = lower | |
1271 | connection.UpperAngle = upper | |
1272 | local limbcollider = Instance.new("Part", limb) | |
1273 | limbcollider.Size = Vector3.new(0.1,1,1) | |
1274 | limbcollider.Shape = "Cylinder" | |
1275 | limbcollider.Transparency = 1 | |
1276 | limbcollider:BreakJoints() | |
1277 | local limbcolliderweld = Instance.new("Weld", limbcollider) | |
1278 | limbcolliderweld.Part0 = limb | |
1279 | limbcolliderweld.Part1 = limbcollider | |
1280 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) | |
1281 | end | |
1282 | local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head) | |
1283 | HeadAttachment.Position = Vector3.new(0, -0.5, 0) | |
1284 | if ragdoll.UpperTorso:findFirstChild("NeckAttachment") then | |
1285 | makehingeconnections(Humanoid.Parent.Head, HeadAttachment, ragdoll.UpperTorso.NeckAttachment, -50, 50) | |
1286 | end | |
1287 | makehingeconnections(Humanoid.Parent.LowerTorso, Humanoid.Parent.LowerTorso.WaistRigAttachment, Humanoid.Parent.UpperTorso.WaistRigAttachment, -50, 50) | |
1288 | makeballconnections(Humanoid.Parent.LeftUpperArm, Humanoid.Parent.LeftUpperArm.LeftShoulderRigAttachment, Humanoid.Parent.UpperTorso.LeftShoulderRigAttachment, -200, 200, 180) | |
1289 | makehingeconnections(Humanoid.Parent.LeftLowerArm, Humanoid.Parent.LeftLowerArm.LeftElbowRigAttachment, Humanoid.Parent.LeftUpperArm.LeftElbowRigAttachment, 0, -60) | |
1290 | makehingeconnections(Humanoid.Parent.LeftHand, Humanoid.Parent.LeftHand.LeftWristRigAttachment, Humanoid.Parent.LeftLowerArm.LeftWristRigAttachment, -20, 20) | |
1291 | -- | |
1292 | makeballconnections(Humanoid.Parent.RightUpperArm, Humanoid.Parent.RightUpperArm.RightShoulderRigAttachment, Humanoid.Parent.UpperTorso.RightShoulderRigAttachment, -200, 200, 180) | |
1293 | makehingeconnections(Humanoid.Parent.RightLowerArm, Humanoid.Parent.RightLowerArm.RightElbowRigAttachment, Humanoid.Parent.RightUpperArm.RightElbowRigAttachment, 0, -60) | |
1294 | makehingeconnections(Humanoid.Parent.RightHand, Humanoid.Parent.RightHand.RightWristRigAttachment, Humanoid.Parent.RightLowerArm.RightWristRigAttachment, -20, 20) | |
1295 | -- | |
1296 | makeballconnections(Humanoid.Parent.RightUpperLeg, Humanoid.Parent.RightUpperLeg.RightHipRigAttachment, Humanoid.Parent.LowerTorso.RightHipRigAttachment, -80, 80, 80) | |
1297 | makehingeconnections(Humanoid.Parent.RightLowerLeg, Humanoid.Parent.RightLowerLeg.RightKneeRigAttachment, Humanoid.Parent.RightUpperLeg.RightKneeRigAttachment, 0, 60) | |
1298 | makehingeconnections(Humanoid.Parent.RightFoot, Humanoid.Parent.RightFoot.RightAnkleRigAttachment, Humanoid.Parent.RightLowerLeg.RightAnkleRigAttachment, -20, 20) | |
1299 | -- | |
1300 | makeballconnections(Humanoid.Parent.LeftUpperLeg, Humanoid.Parent.LeftUpperLeg.LeftHipRigAttachment, Humanoid.Parent.LowerTorso.LeftHipRigAttachment, -80, 80, 80) | |
1301 | makehingeconnections(Humanoid.Parent.LeftLowerLeg, Humanoid.Parent.LeftLowerLeg.LeftKneeRigAttachment, Humanoid.Parent.LeftUpperLeg.LeftKneeRigAttachment, 0, 60) | |
1302 | makehingeconnections(Humanoid.Parent.LeftFoot, Humanoid.Parent.LeftFoot.LeftAnkleRigAttachment, Humanoid.Parent.LeftLowerLeg.LeftAnkleRigAttachment, -20, 20) | |
1303 | for i,v in pairs(Humanoid.Parent:GetChildren()) do | |
1304 | if v.ClassName == "Accessory" then | |
1305 | local attachment1 = v.Handle:findFirstChildOfClass("Attachment") | |
1306 | if attachment1 then | |
1307 | for q,w in pairs(Humanoid.Parent:GetChildren()) do | |
1308 | if w.ClassName == "Part" then | |
1309 | local attachment2 = w:findFirstChild(attachment1.Name) | |
1310 | if attachment2 then | |
1311 | local hinge = Instance.new("HingeConstraint", v.Handle) | |
1312 | hinge.Attachment0 = attachment1 | |
1313 | hinge.Attachment1 = attachment2 | |
1314 | hinge.LimitsEnabled = true | |
1315 | hinge.LowerAngle = 0 | |
1316 | hinge.UpperAngle = 0 | |
1317 | end | |
1318 | end | |
1319 | end | |
1320 | end | |
1321 | end | |
1322 | end | |
1323 | for i,v in pairs(ragdoll:GetChildren()) do | |
1324 | for q,w in pairs(v:GetChildren()) do | |
1325 | if w.ClassName == "Motor6D"--[[ and w.Name ~= "Neck"--]] and w.Name ~= "ouch_weld" then | |
1326 | w:destroy() | |
1327 | end | |
1328 | end | |
1329 | end | |
1330 | if ragdoll:findFirstChild("HumanoidRootPart") then | |
1331 | ragdoll.HumanoidRootPart:destroy() | |
1332 | end | |
1333 | if ragdoll:findFirstChildOfClass("Humanoid") then | |
1334 | - | end)() |
1334 | + | |
1335 | end | |
1336 | local function waitfordatmoment() | |
1337 | wait(0.2) | |
1338 | local function searchforvelocity(wot) | |
1339 | for i,v in pairs(wot:GetChildren()) do | |
1340 | searchforvelocity(v) | |
1341 | if v.ClassName == "BodyPosition" or v.ClassName == "BodyVelocity" then | |
1342 | v:destroy() | |
1343 | end | |
1344 | end | |
1345 | end | |
1346 | searchforvelocity(ragdoll) | |
1347 | end | |
1348 | spawn(waitfordatmoment) | |
1349 | game.Debris:AddItem(ragdoll, 30) | |
1350 | end | |
1351 | end | |
1352 | end | |
1353 | end)) | |
1354 | LocalScript12.Parent = Tool0 | |
1355 | table.insert(cors,sandbox(LocalScript12,function() | |
1356 | end)) | |
1357 | RemoteEvent13.Name = "knifeevent" | |
1358 | RemoteEvent13.Parent = Tool0 | |
1359 | for i,v in pairs(mas:GetChildren()) do | |
1360 | v.Parent = owner.Character | |
1361 | pcall(function() v:MakeJoints() end) | |
1362 | end | |
1363 | mas:Destroy() | |
1364 | for i,v in pairs(cors) do | |
1365 | spawn(function() | |
1366 | pcall(v) | |
1367 | end) | |
1368 | end | |
1369 | NLS([[ | |
1370 | --By Rufus14 | |
1371 | owner = game:GetService("Players").LocalPlayer | |
1372 | character = owner.Character | |
1373 | tool = script.Parent | |
1374 | event = tool:WaitForChild("knifeevent") | |
1375 | mouse = owner:GetMouse() | |
1376 | equipped = false | |
1377 | tool.Equipped:connect(function() | |
1378 | owner = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent) | |
1379 | character = owner.Character | |
1380 | equipped = true | |
1381 | end) | |
1382 | tool.Unequipped:connect(function() | |
1383 | equipped = false | |
1384 | end) | |
1385 | mouse.KeyDown:connect(function(key) | |
1386 | key = key:lower() | |
1387 | if key == "e" and equipped then | |
1388 | event:FireServer("skin") | |
1389 | end | |
1390 | end) | |
1391 | mouse.Button1Up:connect(function() | |
1392 | event:FireServer("throw", mouse.Hit) | |
1393 | end) | |
1394 | ]], Tool0) |