Advertisement
Guest User

grab knife v2

a guest
Jan 18th, 2023
1,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.19 KB | None | 0 0
  1. me = game.Players.LocalPlayer
  2. char = me.Character
  3. selected = false
  4. attacking = false
  5. hurt = false
  6. grabbed = nil
  7. mode = "kill"
  8. bloodcolors = {"Bright red", "Really red", "Crimson"}
  9. enabled = true
  10. enabled2 = true
  11.  
  12. local breaksound = Instance.new("Sound")
  13. breaksound.SoundId = "http://www.roblox.com/asset/?id=2801263"
  14. breaksound.Parent = game.Workspace
  15. breaksound.Volume = 0.8
  16.  
  17. local killsound = Instance.new("Sound")
  18. killsound.SoundId = "http://www.roblox.com/asset?id=16950449"
  19. killsound.Pitch = 0.65
  20. killsound.Parent = game.Workspace
  21.  
  22. local drainsound = Instance.new("Sound")
  23. drainsound.SoundId = "http://www.roblox.com/asset/?id=2785493"
  24. drainsound.Pitch = 0.7
  25.  
  26.  
  27. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  28. part.Parent = parent
  29. part.formFactor = form
  30. part.CanCollide = collide
  31. part.Transparency = tran
  32. part.Reflectance = ref
  33. part.Size = Vector3.new(x,y,z)
  34. part.BrickColor = BrickColor.new(color)
  35. part.TopSurface = 0
  36. part.BottomSurface = 0
  37. part.Anchored = anchor
  38. part.Locked = true
  39. part:BreakJoints()
  40. end
  41.  
  42. function weld(w, p, p1, a, b, c, x, y, z)
  43. w.Parent = p
  44. w.Part0 = p
  45. w.Part1 = p1
  46. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  47. end
  48.  
  49. function mesh(mesh, parent, x, y, z, type)
  50. mesh.Parent = parent
  51. mesh.Scale = Vector3.new(x, y, z)
  52. mesh.MeshType = type
  53. end
  54.  
  55. function remgui()
  56. for _,v in pairs(me.PlayerGui:GetChildren()) do
  57. if v.Name == "Modeshow" then
  58. v:remove()
  59. end
  60. end
  61. end
  62.  
  63. function inform(text,delay)
  64. remgui()
  65. local sc = Instance.new("ScreenGui")
  66. sc.Parent = me.PlayerGui
  67. sc.Name = "Modeshow"
  68. local bak = Instance.new("Frame",sc)
  69. bak.BackgroundColor3 = Color3.new(1,1,1)
  70. bak.Size = UDim2.new(0.94,0,0.1,0)
  71. bak.Position = UDim2.new(0.03,0,0.037,0)
  72. bak.BorderSizePixel = 0
  73. local gi = Instance.new("TextLabel",sc)
  74. gi.Size = UDim2.new(0.92,0,0.09,0)
  75. gi.BackgroundColor3 = Color3.new(0,0,0)
  76. gi.Position = UDim2.new(0.04,0,0.042,0)
  77. gi.TextColor3 = Color3.new(1,1,1)
  78. gi.FontSize = "Size14"
  79. gi.Text = text
  80. coroutine.resume(coroutine.create(function()
  81. wait(delay)
  82. sc:remove()
  83. end))
  84. end
  85.  
  86. if char:findFirstChild("Bricks",true) then
  87. char:findFirstChild("Bricks",true):remove()
  88. end
  89.  
  90. bricks = Instance.new("Model",me.Character)
  91. bricks.Name = "Bricks"
  92.  
  93. --Parts-------------------------Parts-------------------------Parts-------------------------Parts----------------------
  94.  
  95. rarm = char:findFirstChild("Right Arm")
  96. larm = char:findFirstChild("Left Arm")
  97. lleg = char:findFirstChild("Left Leg")
  98. torso = char:findFirstChild("Torso")
  99. hum = char:findFirstChild("Humanoid")
  100. rleg = char:findFirstChild("Right Leg")
  101.  
  102. righthold = Instance.new("Part")
  103. prop(righthold, bricks, false, 1, 0, 0.1, 0.1, 0.1, "Mid gray", false, "Custom")
  104. w11 = Instance.new("Weld")
  105. weld(w11, rarm, righthold, 0, 0, 0, 0, 1, 0)
  106.  
  107. lefthold = Instance.new("Part")
  108. prop(lefthold, bricks, false, 1, 0, 0.1, 0.1, 0.1, "Mid gray", false, "Custom")
  109. w12 = Instance.new("Weld")
  110. weld(w12, larm, lefthold, 0, 0, 0, 0, 1, 0)
  111.  
  112. hold = Instance.new("Part")
  113. prop(hold, bricks, false, 0, 0, 0.2, 0.3, 0.3, "Black", false, "Custom")
  114. oh = Instance.new("Weld")
  115. weld(oh, torso, hold, -math.pi/-0.86, 1.5, math.rad(0), -0.35, -0.4, -0.5)
  116.  
  117. knife = Instance.new("Part")
  118. knife.Material = "Wood"
  119. prop(knife, bricks, false, 0, 0, 0.25, 1.1, 0.3, "Pine Cone", false, "Custom")
  120. orr = Instance.new("Weld")
  121. weld(orr, hold, knife, 0, 0, 0, 0, 0.7, 0)
  122. ar = Instance.new("Weld")
  123. weld(ar, lefthold, nil, math.pi/2, 0, math.pi, 0, 0, 0)
  124.  
  125. blade = Instance.new("Part")
  126. blade.Material = "Neon"
  127. prop(blade, bricks, false, 0, 0, 0.1, 2.5, 0.25, "Mid gray", false, "Custom")
  128. Instance.new("BlockMesh",blade).Scale = Vector3.new(0.3,1,1)
  129. w2 = Instance.new("Weld")
  130. weld(w2, knife, blade, 0, 0, 0, 0, -0.65, 0)
  131.  
  132. blade2 = Instance.new("Part")
  133. blade2.Material = "Neon"
  134. prop(blade2, bricks, false, 0, 0, 0.1, 0.4, 0.25, "Mid gray", false, "Custom")
  135. local mew = Instance.new("SpecialMesh",blade2)
  136. mew.MeshType = "Wedge"
  137. mew.Scale = Vector3.new(0.3,1,1)
  138. w3 = Instance.new("Weld")
  139. weld(w3, blade, blade2, 0, 0, 0, 0, -1.45, 0)
  140.  
  141.  
  142. rb = Instance.new("Part")
  143. prop(rb, bricks, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom")
  144. w13 = Instance.new("Weld")
  145. weld(w13, torso, rb, 0, 0, 0, -1.5, -0.5, 0)
  146.  
  147. lb = Instance.new("Part")
  148. prop(lb, bricks, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom")
  149. w14 = Instance.new("Weld")
  150. weld(w14, torso, lb, 0, 0, 0, 1.5, -0.5, 0)
  151.  
  152. rw = Instance.new("Weld")
  153. weld(rw, rb, nil, 0, 0, 0, 0, 0.5, 0)
  154.  
  155. lw = Instance.new("Weld")
  156. weld(lw, lb, nil, 0, 0, 0, 0, 0.5, 0)
  157.  
  158. grabweld = nil
  159. platlol = nil
  160. lolhum = nil
  161.  
  162. function touch(h)
  163. if hurt then
  164. if grabbed == nil then
  165. local hu = h.Parent:findFirstChild("Humanoid")
  166. local head = h.Parent:findFirstChild("Head")
  167. local torz = h.Parent:findFirstChild("Torso")
  168. if hu ~= nil and head ~= nil and torz ~= nil and h.Parent.Name ~= name then
  169. if hu.Health > 0 then
  170. grabbed = torz
  171. hu.PlatformStand = true
  172. local w = Instance.new("Weld")
  173. weld(w,righthold,grabbed,math.pi/2,0.2,0,0.7,-0.9,-0.6)
  174. grabweld = w
  175. lolhum = hu
  176. local lolxd = true
  177. platlol = lolxd
  178. hu.Changed:connect(function(prop)
  179. if prop == "PlatformStand" and platlol then
  180. hu.PlatformStand = true
  181. end
  182. end)
  183. end
  184. end
  185. end
  186. end
  187. end
  188.  
  189. righthold.Touched:connect(touch)
  190. lefthold.Touched:connect(touch)
  191.  
  192. function bleed(part,po)
  193. local lol1 = math.random(5,30)/100
  194. local lol2 = math.random(5,30)/100
  195. local lol3 = math.random(5,30)/100
  196. local lol4 = math.random(1,#bloodcolors)
  197. local p = Instance.new("Part")
  198. prop(p,part.Parent,false,0,0,lol1,lol2,lol3,bloodcolors[lol4],false,"Custom")
  199. p.CFrame = part.CFrame * CFrame.new(math.random(-5,5)/10,po,math.random(-5,5)/10)
  200. p.Velocity = Vector3.new(math.random(-25,25),math.random(-25,25),math.random(-25,25))
  201. p.RotVelocity = Vector3.new(math.random(-400,400)/10,math.random(-400,400)/10,math.random(-400,400)/10)
  202. p.CanCollide = true
  203. coroutine.resume(coroutine.create(function()
  204. wait(3)
  205. p:remove()
  206. end))
  207. end
  208.  
  209. h = Instance.new("HopperBin",me.Backpack)
  210.  
  211. h.Name = "Knife"
  212.  
  213. script.Parent = h
  214.  
  215.  
  216. bin = h
  217.  
  218.  
  219.  
  220. function select(mouse)
  221. orr.Part1 = nil
  222. ar.Part1 = knife
  223. mouse.Button1Down:connect(function()
  224. if attacking == false then
  225. attacking = true
  226. lw.Part1 = larm
  227. rw.Part1 = rarm
  228. hurt = true
  229. for i=1, 8 do
  230. rw.C0 = rw.C0 * CFrame.new(-0.03,0,-0.08) * CFrame.fromEulerAnglesXYZ(0.18,0.04,0)
  231. lw.C0 = lw.C0 * CFrame.new(0.06,0,-0.06) * CFrame.fromEulerAnglesXYZ(0.15,-0.11,-0.05)
  232. wait()
  233. end
  234. wait(1)
  235. hurt = false
  236. if grabbed == nil then
  237. for i=1, 4 do
  238. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  239. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.12) * CFrame.fromEulerAnglesXYZ(-0.3,0.22,0.05)
  240. wait()
  241. end
  242. lw.C0 = CFrame.new(0,0,0)
  243. rw.C0 = CFrame.new(0,0,0)
  244. lw.Part1 = nil
  245. rw.Part1 = nil
  246. attacking = false
  247. end
  248. elseif hurt == false and grabbed ~= nil and mode == "drop" then
  249. enabled2 = true
  250. grabweld:remove()
  251. grabweld = nil
  252. platlol = false
  253. grabbed = nil
  254. lolhum.PlatformStand = false
  255. lolhum = nil
  256. for i=1, 4 do
  257. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  258. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.3,0.2,0)
  259. wait()
  260. end
  261. lw.C0 = CFrame.new(0,0,0)
  262. rw.C0 = CFrame.new(0,0,0)
  263. lw.Part1 = nil
  264. rw.Part1 = nil
  265. attacking = false
  266. platlol = nil
  267.  
  268. elseif hurt == false and grabbed ~= nil and grabweld ~= nil and mode == "para" and enabled2 == true then
  269. enabled2 = false
  270. enabled = false
  271.  
  272. breaksound.Parent = grabbed
  273. breaksound:Play()
  274.  
  275. for i=1, 5 do
  276. lw.C0 = lw.C0 * CFrame.new(0.02,0.15,-0.02) * CFrame.fromEulerAnglesXYZ(-0.05,0,-0.03)
  277. wait()
  278. end
  279. local duh = grabbed
  280. bleed(duh,1)
  281. bleed(duh,1)
  282. bleed(duh,1)
  283. bleed(duh,1)
  284. bleed(duh,1)
  285. bleed(duh,1)
  286. bleed(duh,1)
  287. bleed(duh,1)
  288. bleed(duh,1)
  289. bleed(duh,1)
  290. wait(0.12)
  291. for i=1, 5 do
  292. lw.C0 = lw.C0 * CFrame.new(-0.02,-0.15,0.02) * CFrame.fromEulerAnglesXYZ(0.05,-0,0.03)
  293. wait()
  294. end
  295.  
  296.  
  297. if grabbed.Parent:findFirstChild("HumanoidRootPart",true) then
  298. grabbed.Parent.HumanoidRootPart:Remove()
  299. end
  300. grabbed.Parent.Humanoid.Health = grabbed.Parent.Humanoid.Health / 1.5
  301.  
  302. elseif hurt == false and grabbed ~= nil and grabweld ~= nil and mode == "drain" and enabled == true then
  303. enabled = false
  304. enabled2 = true
  305.  
  306. for i=1, 2 do
  307. lw.C0 = lw.C0 * CFrame.new(0.06,0,-0.06) * CFrame.fromEulerAnglesXYZ(0.15,-0.11,-0.05)
  308. wait()
  309. end
  310.  
  311. while char.Humanoid.Health == char.Humanoid.MaxHealth do
  312. bleed(grabbed, 1)
  313. char.Humanoid.Health = char.Humanoid.Health + 1
  314. grabbed.Parent.Humanoid.Health = grabbed.Parent.Humanoid.Health - 1
  315. wait(0.0335)
  316. end
  317.  
  318. for i=1, 1 do
  319. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.12) * CFrame.fromEulerAnglesXYZ(-0.3,0.22,0.05)
  320. wait()
  321. end
  322. enabled = true
  323.  
  324.  
  325. elseif hurt == false and grabbed ~= nil and grabweld ~= nil and mode == "throw" then
  326. enabled2 = true
  327. grabweld:remove()
  328. grabweld = nil
  329. local bf = Instance.new("BodyForce",grabbed)
  330. bf.force = torso.CFrame.lookVector * 4000
  331. bf.force = bf.force + Vector3.new(0,1500,0)
  332. coroutine.resume(coroutine.create(function()
  333. wait(0.12)
  334. bf:remove()
  335. end))
  336. for i=1, 6 do
  337. rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.35,0,0)
  338. lw.C0 = lw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.18,0,0)
  339. wait()
  340. end
  341. for i=1, 4 do
  342. rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.47,0,0)
  343. lw.C0 = lw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.2,0,0)
  344. wait()
  345. end
  346. wait(0.2)
  347. platlol = false
  348. grabbed = nil
  349. lolhum.PlatformStand = false
  350. lolhum = nil
  351. for i=1, 4 do
  352. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  353. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.3,0.2,0)
  354. wait()
  355. end
  356. lw.C0 = CFrame.new(0,0,0)
  357. rw.C0 = CFrame.new(0,0,0)
  358. lw.Part1 = nil
  359. rw.Part1 = nil
  360. attacking = false
  361. platlol = nil
  362. elseif hurt == false and grabbed ~= nil and lolhum ~= nil and grabweld ~= nil and mode == "kill" then
  363. enabled2 = true
  364. killsound.Parent = grabbed
  365. killsound:Play()
  366. for i=1, 5 do
  367. lw.C0 = lw.C0 * CFrame.new(0.02,0.12,0.1) * CFrame.fromEulerAnglesXYZ(-0.05,0,-0.03)
  368. wait()
  369. end
  370. local ne = grabbed:findFirstChild("Neck")
  371. coroutine.resume(coroutine.create(function()
  372. local duh = grabbed
  373. local duh2 = grabbed.Parent.Head
  374. local lolas = lolhum
  375. duh.RotVelocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  376. for i=1, 75 do
  377. wait()
  378. local hm = math.random(1,15)
  379. pcall(function()
  380. if hm == 1 then
  381. duh2.Sound.Pitch = math.random(90,110)/100
  382. duh2.Sound:play()
  383. script.Parent.Splat:Play();
  384. end
  385. end)
  386.  
  387. if hm > 0 and hm < 4 then
  388.  
  389. bleed(duh,1)
  390. bleed(duh2,-0.1)
  391. bleed(duh,1)
  392. bleed(duh2,-0.1)
  393. bleed(duh,1)
  394. bleed(duh,1)
  395. bleed(duh,1)
  396. end
  397. end
  398. wait(1.2)
  399.  
  400. lolas.Health = 0
  401. for i=1, 85 do
  402. wait()
  403. local hm = math.random(1,9)
  404. pcall(function()
  405. if hm == 1 then
  406. duh2.Sound.Pitch = math.random(90,110)/100
  407. duh2.Sound:play()
  408. end
  409. end)
  410. if hm > 0 and hm < 3 then
  411. bleed(duh,1)
  412. bleed(duh2,-0.5)
  413. end
  414. end
  415. end))
  416. for i=1, 3 do
  417. lw.C0 = lw.C0 * CFrame.new(0.02,0.12,0.1) * CFrame.fromEulerAnglesXYZ(-0.05,0,-0.03)
  418. if ne ~= nil then
  419. grabbed.Neck.C0 = grabbed.Neck.C0 * CFrame.fromEulerAnglesXYZ(-0.35,0,0)
  420. end
  421. wait()
  422. end
  423. grabweld:remove()
  424. grabweld = nil
  425. for i=1, 4 do
  426. lw.C0 = lw.C0 * CFrame.new(-0.04,-0.24,-0.2) * CFrame.fromEulerAnglesXYZ(0.1,0,0.06)
  427. wait()
  428. end
  429. for i=1, 4 do
  430. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  431. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.12) * CFrame.fromEulerAnglesXYZ(-0.3,0.22,0.05)
  432. wait()
  433. end
  434. lw.C0 = CFrame.new(0,0,0)
  435. rw.C0 = CFrame.new(0,0,0)
  436. lw.Part1 = nil
  437. rw.Part1 = nil
  438. platlol = false
  439. grabbed = nil
  440. lolhum = nil
  441. attacking = false
  442. platlol = nil
  443. end
  444. end)
  445. mouse.KeyDown:connect(function(kai)
  446. key = kai:lower()
  447. if key == "q" then
  448. mode = "drop"
  449. inform("Release",1)
  450. elseif key == "e" then
  451. mode = "throw"
  452. inform("Push",1)
  453. elseif key == "f" then
  454. mode = "kill"
  455. inform("Kill",1)
  456. elseif key == "c" then
  457. mode = "para"
  458. inform("Paralyze",1)
  459. elseif key == "x" then
  460. mode = "drain"
  461. inform("Drain",1)
  462. end
  463. end)
  464. end
  465.  
  466. function desel()
  467. repeat wait() until attacking == false
  468. orr.Part1 = knife
  469. ar.Part1 = nil
  470. end
  471.  
  472. bin.Selected:connect(select)
  473. bin.Deselected:connect(desel)
  474.  
  475. char.Humanoid.Died:connect(function()
  476. pcall(function()
  477. grabweld:remove()
  478. grabweld = nil
  479. grabbed = nil
  480. platlol = false
  481. platlol = nil
  482. end)
  483. end)
  484.  
  485. inform("Knife Aquired",2)
  486.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement