Advertisement
RiasGremory0100

knife edit 2

Dec 31st, 2019
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.40 KB | None | 0 0
  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. attach1.Position = Vector3.new(0, -0.2, 0.15)
  78. attach2.Position = Vector3.new(0, 0.7, 0.15)
  79. Trail7.Attachment0 = attach1
  80. Trail7.Attachment1 = attach2
  81. Trail7.Enabled = false
  82. Trail7.LightInfluence = 1
  83. Trail7.Transparency = NumberSequence.new(0.8125,1)
  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. 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. 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 = false
  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. stabsound.SoundId = "rbxassetid://1559093526"
  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. 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/200)/400,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/200)/400,-math.pi/3+math.sin(-throwsine/200)/400,0), 0.2)
  714. leftarmweld.C0 = leftarmweld.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(400)+math.sin(throwsine/200)/150,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/200)/200+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. 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)
  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 = 5000000
  750. local gravitypower = 0
  751. local lasttorsopos = character.Torso.CFrame
  752. while step:wait() and not rayhit do
  753. throwtime = throwtime - 100
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement