Advertisement
TheownerFescripts

Untitled

Jul 6th, 2021
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.94 KB | None | 0 0
  1. script.Parent.Event.OnServerEvent:Connect(function(client)
  2.  
  3. script.Parent.Name = "GrabKnife"
  4.  
  5. local selected = false
  6.  
  7. local attacking = false
  8.  
  9. local hurt = false
  10.  
  11. local grabbed = nil
  12.  
  13. local char = script.Parent.Parent
  14.  
  15. local mode = "drop"
  16.  
  17. script.Parent.KeyQ.OnServerEvent:Connect(function(client)
  18. mode = "drop"
  19. end)
  20.  
  21. script.Parent.KeyE.OnServerEvent:Connect(function(client)
  22. mode = "throw"
  23. end)
  24.  
  25. script.Parent.KeyF.OnServerEvent:Connect(function(client)
  26. mode = "kill"
  27. end)
  28.  
  29. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  30.  
  31. part.Parent = parent
  32.  
  33. part.formFactor = form
  34.  
  35. part.CanCollide = collide
  36.  
  37. part.Transparency = tran
  38.  
  39. part.Reflectance = ref
  40.  
  41. part.Size = Vector3.new(x,y,z)
  42.  
  43. part.BrickColor = BrickColor.new(color)
  44.  
  45. part.TopSurface = 0
  46.  
  47. part.BottomSurface = 0
  48.  
  49. part.Anchored = anchor
  50.  
  51. part.Locked = true
  52.  
  53. part:BreakJoints()
  54.  
  55. end
  56.  
  57.  
  58. function weld(w, p, p1, a, b, c, x, y, z)
  59.  
  60. w.Parent = p
  61.  
  62. w.Part0 = p
  63.  
  64. w.Part1 = p1
  65.  
  66. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  67.  
  68. end
  69.  
  70.  
  71. function mesh(mesh, parent, x, y, z, type)
  72.  
  73. mesh.Parent = parent
  74.  
  75. mesh.Scale = Vector3.new(x, y, z)
  76.  
  77. mesh.MeshType = type
  78.  
  79. end
  80.  
  81. if char:findFirstChild("Bricks",true) then
  82.  
  83. char:findFirstChild("Bricks",true):remove()
  84.  
  85. end
  86.  
  87.  
  88. local bricks = Instance.new("Model",char)
  89.  
  90. bricks.Name = "Bricks"
  91.  
  92.  
  93. --Parts-------------------------Parts-------------------------Parts-------------------------Parts----------------------
  94.  
  95.  
  96. local rarm = char:findFirstChild("Right Arm")
  97.  
  98. local larm = char:findFirstChild("Left Arm")
  99.  
  100. local lleg = char:findFirstChild("Left Leg")
  101.  
  102. local torso = char:findFirstChild("Torso")
  103.  
  104. local hum = char:FindFirstChildWhichIsA("Humanoid")
  105.  
  106.  
  107. local righthold = Instance.new("Part")
  108.  
  109. prop(righthold, bricks, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
  110.  
  111. local w11 = Instance.new("Weld")
  112.  
  113. weld(w11, rarm, righthold, 0, 0, 0, 0, 1, 0)
  114.  
  115.  
  116. local lefthold = Instance.new("Part")
  117.  
  118. prop(lefthold, bricks, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
  119.  
  120. local w12 = Instance.new("Weld")
  121.  
  122. weld(w12, larm, lefthold, 0, 0, 0, 0, 1, 0)
  123.  
  124.  
  125. local hold = Instance.new("Part")
  126.  
  127. prop(hold, bricks, false, 0, 0, 0.2, 0.4, 0.7, "Really red", false, "Custom")
  128.  
  129. local oh = Instance.new("Weld")
  130.  
  131. weld(oh, lleg, hold, -math.pi/1.4, 0, math.rad(35), 0.55, -0.9, 0.3)
  132.  
  133.  
  134. local knife = Instance.new("Part")
  135.  
  136. prop(knife, bricks, false, 0, 0, 0.35, 1.1, 0.5, "Really black", false, "Custom")
  137.  
  138. local orr = Instance.new("Weld")
  139.  
  140. weld(orr, hold, knife, 0, 0, 0, 0, 0.7, 0)
  141.  
  142. local ar = Instance.new("Weld")
  143.  
  144. weld(ar, lefthold, nil, math.pi/2, 0, math.pi, 0, 0, 0)
  145.  
  146.  
  147.  
  148. local blade = Instance.new("Part")
  149.  
  150. prop(blade, bricks, false, 0, 0, 0.1, 1.5, 0.4, "Medium grey", false, "Custom")
  151.  
  152. Instance.new("BlockMesh",blade).Scale = Vector3.new(0.3,1,1)
  153.  
  154. local w2 = Instance.new("Weld")
  155.  
  156. weld(w2, knife, blade, 0, 0, 0, 0, -1.2, 0)
  157.  
  158.  
  159. local blade2 = Instance.new("Part")
  160.  
  161. prop(blade2, bricks, false, 0, 0, 0.1, 0.5, 0.4, "Medium grey", false, "Custom")
  162.  
  163. local mew = Instance.new("SpecialMesh",blade2)
  164.  
  165. mew.MeshType = "Wedge"
  166.  
  167. mew.Scale = Vector3.new(0.3,1,1)
  168.  
  169. local w3 = Instance.new("Weld")
  170.  
  171. weld(w3, blade, blade2, 0, 0, 0, 0, -1, 0)
  172.  
  173.  
  174.  
  175.  
  176.  
  177. local rb = Instance.new("Part")
  178.  
  179. prop(rb, bricks, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
  180.  
  181. local w13 = Instance.new("Weld")
  182.  
  183. weld(w13, torso, rb, 0, 0, 0, -1.5, -0.5, 0)
  184.  
  185.  
  186. local lb = Instance.new("Part")
  187.  
  188. prop(lb, bricks, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
  189.  
  190. local w14 = Instance.new("Weld")
  191.  
  192. weld(w14, torso, lb, 0, 0, 0, 1.5, -0.5, 0)
  193.  
  194.  
  195. local rw = Instance.new("Weld")
  196.  
  197. weld(rw, rb, nil, 0, 0, 0, 0, 0.5, 0)
  198.  
  199.  
  200. local lw = Instance.new("Weld")
  201.  
  202. weld(lw, lb, nil, 0, 0, 0, 0, 0.5, 0)
  203.  
  204.  
  205. local grabweld = nil
  206.  
  207. local platlol = nil
  208.  
  209. local lolhum = nil
  210.  
  211.  
  212. function touch(h)
  213.  
  214. if hurt then
  215.  
  216. if grabbed == nil then
  217.  
  218. local hu = h.Parent:findFirstChildWhichIsA("Humanoid")
  219.  
  220. local head = h.Parent:findFirstChild("Head")
  221.  
  222. local torz = h.Parent:findFirstChild("Torso")
  223.  
  224. if hu ~= nil and head ~= nil and torz ~= nil then
  225.  
  226. if hu.Health > 0 then
  227.  
  228. grabbed = torz
  229.  
  230. hu.PlatformStand = true
  231.  
  232. local w = Instance.new("Weld")
  233.  
  234. weld(w,righthold,grabbed,math.pi/2,0.2,0,0.7,-0.9,-0.6)
  235.  
  236. grabweld = w
  237.  
  238. lolhum = hu
  239.  
  240. local lolxd = true
  241.  
  242. platlol = lolxd
  243.  
  244. hu.Changed:connect(function(prop)
  245.  
  246. if prop == "PlatformStand" and platlol then
  247.  
  248. hu.PlatformStand = true
  249.  
  250. end
  251.  
  252. end)
  253.  
  254. end
  255.  
  256. end
  257.  
  258. end
  259.  
  260. end
  261.  
  262. end
  263.  
  264.  
  265. righthold.Touched:connect(touch)
  266.  
  267. lefthold.Touched:connect(touch)
  268.  
  269. script.Parent.Click.OnServerEvent:Connect(function(client)
  270.  
  271. orr.Part1 = nil
  272.  
  273. ar.Part1 = knife
  274.  
  275. if attacking == false then
  276.  
  277. attacking = true
  278.  
  279. lw.Part1 = larm
  280.  
  281. rw.Part1 = rarm
  282.  
  283. hurt = true
  284.  
  285. for i=1, 8 do
  286.  
  287. rw.C0 = rw.C0 * CFrame.new(-0.03,0,-0.08) * CFrame.fromEulerAnglesXYZ(0.18,0.04,0)
  288.  
  289. lw.C0 = lw.C0 * CFrame.new(0.06,0,-0.06) * CFrame.fromEulerAnglesXYZ(0.15,-0.11,-0.05)
  290.  
  291. wait(0.1)
  292.  
  293. end
  294.  
  295. wait(1)
  296.  
  297. hurt = false
  298.  
  299. if grabbed == nil then
  300.  
  301. for i=1, 4 do
  302.  
  303. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  304.  
  305. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.12) * CFrame.fromEulerAnglesXYZ(-0.3,0.22,0.05)
  306.  
  307. wait(0.1)
  308.  
  309. end
  310.  
  311. lw.C0 = CFrame.new(0,0,0)
  312.  
  313. rw.C0 = CFrame.new(0,0,0)
  314.  
  315. lw.Part1 = nil
  316.  
  317. rw.Part1 = nil
  318.  
  319. attacking = false
  320.  
  321. end
  322.  
  323. elseif hurt == false and grabbed ~= nil and mode == "drop" then
  324.  
  325. grabweld:remove()
  326.  
  327. grabweld = nil
  328.  
  329. platlol = false
  330.  
  331. grabbed = nil
  332.  
  333. lolhum.PlatformStand = false
  334.  
  335. lolhum = nil
  336.  
  337. for i=1, 4 do
  338.  
  339. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  340.  
  341. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.3,0.2,0)
  342.  
  343. wait(0.1)
  344.  
  345. end
  346.  
  347. lw.C0 = CFrame.new(0,0,0)
  348.  
  349. rw.C0 = CFrame.new(0,0,0)
  350.  
  351. lw.Part1 = nil
  352.  
  353. rw.Part1 = nil
  354.  
  355. attacking = false
  356.  
  357. platlol = nil
  358.  
  359. elseif hurt == false and grabbed ~= nil and grabweld ~= nil and mode == "throw" then
  360.  
  361. grabweld:remove()
  362.  
  363. grabweld = nil
  364.  
  365. local bf = Instance.new("BodyForce",grabbed)
  366.  
  367. bf.force = torso.CFrame.lookVector * 8500
  368.  
  369. bf.force = bf.force + Vector3.new(0,7400,0)
  370.  
  371. coroutine.resume(coroutine.create(function()
  372.  
  373. wait(0.12)
  374.  
  375. bf:remove()
  376.  
  377. end))
  378.  
  379. for i=1, 6 do
  380.  
  381. rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.35,0,0)
  382.  
  383. lw.C0 = lw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.18,0,0)
  384.  
  385. wait(0.1)
  386.  
  387. end
  388.  
  389. for i=1, 4 do
  390.  
  391. rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.47,0,0)
  392.  
  393. lw.C0 = lw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.2,0,0)
  394.  
  395. wait(0.1)
  396.  
  397. end
  398.  
  399. wait(0.2)
  400.  
  401. platlol = false
  402.  
  403. grabbed = nil
  404.  
  405. lolhum.PlatformStand = false
  406.  
  407. lolhum = nil
  408.  
  409. for i=1, 4 do
  410.  
  411. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  412.  
  413. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.3,0.2,0)
  414.  
  415. wait(0.1)
  416.  
  417. end
  418.  
  419. lw.C0 = CFrame.new(0,0,0)
  420.  
  421. rw.C0 = CFrame.new(0,0,0)
  422.  
  423. lw.Part1 = nil
  424.  
  425. rw.Part1 = nil
  426.  
  427. attacking = false
  428.  
  429. platlol = nil
  430.  
  431. elseif hurt == false and grabbed ~= nil and lolhum ~= nil and grabweld ~= nil and mode == "kill" then
  432.  
  433. for i=1, 5 do
  434.  
  435. lw.C0 = lw.C0 * CFrame.new(0.02,0.12,0.1) * CFrame.fromEulerAnglesXYZ(-0.05,0,-0.03)
  436.  
  437. wait(0.1)
  438.  
  439. end
  440.  
  441. local ne = grabbed:findFirstChild("Neck")
  442.  
  443. coroutine.resume(coroutine.create(function()
  444.  
  445. local duh = grabbed
  446.  
  447. local duh2 = grabbed.Parent.Head
  448.  
  449. local lolas = lolhum
  450.  
  451. duh.RotVelocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  452.  
  453. for i=1, 60 do
  454.  
  455. wait(0.1)
  456.  
  457. local hm = math.random(1,9)
  458.  
  459. pcall(function()
  460.  
  461. if hm == 1 then
  462.  
  463. local Sound = Instance.new("Sound", duh2)
  464.  
  465. Sound.SoundId = "rbxassetid://4792539171"
  466.  
  467. duh2.Sound.Pitch = math.random(90,110)/100
  468.  
  469. duh2.Sound:play()
  470.  
  471. end
  472.  
  473. end)
  474.  
  475. if hm > 0 and hm < 3 then
  476.  
  477.  
  478.  
  479. end
  480.  
  481. end
  482.  
  483. lolas.Health = 0
  484.  
  485. for i=1, 85 do
  486.  
  487. wait(0.1)
  488.  
  489. local hm = math.random(1,9)
  490.  
  491. pcall(function()
  492.  
  493. if hm == 1 then
  494.  
  495. duh2.Sound.Pitch = math.random(90,110)/100
  496.  
  497. duh2.Sound:play()
  498.  
  499. end
  500.  
  501. end)
  502.  
  503. if hm > 0 and hm < 3 then
  504.  
  505.  
  506.  
  507. end
  508.  
  509. end
  510.  
  511. end))
  512.  
  513. for i=1, 3 do
  514.  
  515. lw.C0 = lw.C0 * CFrame.new(0.02,0.12,0.1) * CFrame.fromEulerAnglesXYZ(-0.05,0,-0.03)
  516.  
  517. if ne ~= nil then
  518.  
  519. grabbed.Neck.C0 = grabbed.Neck.C0 * CFrame.fromEulerAnglesXYZ(-0.35,0,0)
  520.  
  521. end
  522.  
  523. wait(0.1)
  524.  
  525. end
  526.  
  527. grabweld:remove()
  528.  
  529. grabweld = nil
  530.  
  531. for i=1, 4 do
  532.  
  533. lw.C0 = lw.C0 * CFrame.new(-0.04,-0.24,-0.2) * CFrame.fromEulerAnglesXYZ(0.1,0,0.06)
  534.  
  535. wait(0.1)
  536.  
  537. end
  538.  
  539. for i=1, 4 do
  540.  
  541. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  542.  
  543. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.12) * CFrame.fromEulerAnglesXYZ(-0.3,0.22,0.05)
  544.  
  545. wait(0.1)
  546.  
  547. end
  548.  
  549. lw.C0 = CFrame.new(0,0,0)
  550.  
  551. rw.C0 = CFrame.new(0,0,0)
  552.  
  553. lw.Part1 = nil
  554.  
  555. rw.Part1 = nil
  556.  
  557. platlol = false
  558.  
  559. grabbed = nil
  560.  
  561. lolhum = nil
  562.  
  563. attacking = false
  564.  
  565. platlol = nil
  566.  
  567. end
  568.  
  569. script.Parent.Unequip.OnServerEvent:Connect(function(client)
  570.  
  571. repeat wait(0.1) until attacking == false
  572.  
  573. orr.Part1 = knife
  574.  
  575. ar.Part1 = nil
  576.  
  577. script.Parent.Died.OnServerEvent:Connect(function(client)
  578.  
  579. pcall(function()
  580.  
  581. grabweld:remove()
  582.  
  583. grabweld = nil
  584.  
  585. grabbed = nil
  586.  
  587. platlol = false
  588.  
  589. platlol = nil
  590.  
  591.  
  592. end)
  593. end)
  594. end)
  595. end)
  596. end)
  597.  
  598.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement