Advertisement
ryanswagg20

Knife

Sep 11th, 2016 (edited)
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.87 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 = "drop"
  8. bloodcolors = {"Bright red", "Really red"}
  9. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  10. part.Parent = parent
  11. part.formFactor = form
  12. part.CanCollide = collide
  13. part.Transparency = tran
  14. part.Reflectance = ref
  15. part.Size = Vector3.new(x,y,z)
  16. part.BrickColor = BrickColor.new(color)
  17. part.TopSurface = 0
  18. part.BottomSurface = 0
  19. part.Anchored = anchor
  20. part.Locked = true
  21. part:BreakJoints()
  22. end
  23. function weld(w, p, p1, a, b, c, x, y, z)
  24. w.Parent = p
  25. w.Part0 = p
  26. w.Part1 = p1
  27. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  28. end
  29. function mesh(mesh, parent, x, y, z, type)
  30. mesh.Parent = parent
  31. mesh.Scale = Vector3.new(x, y, z)
  32. mesh.MeshType = type
  33. end
  34. function remgui()
  35. for _,v in pairs(me.PlayerGui:GetChildren()) do
  36. if v.Name == "Modeshow" then
  37. v:remove()
  38. end
  39. end
  40. end
  41. function inform(text,delay)
  42. remgui()
  43. local sc = Instance.new("ScreenGui")
  44. sc.Parent = me.PlayerGui
  45. sc.Name = "Modeshow"
  46. local bak = Instance.new("Frame",sc)
  47. bak.BackgroundColor3 = Color3.new(1,1,1)
  48. bak.Size = UDim2.new(0.94,0,0.1,0)
  49. bak.Position = UDim2.new(0.03,0,0.037,0)
  50. bak.BorderSizePixel = 0
  51. local gi = Instance.new("TextLabel",sc)
  52. gi.Size = UDim2.new(0.92,0,0.09,0)
  53. gi.BackgroundColor3 = Color3.new(0,0,0)
  54. gi.Position = UDim2.new(0.04,0,0.042,0)
  55. gi.TextColor3 = Color3.new(1,1,1)
  56. gi.FontSize = "Size12"
  57. gi.Text = text
  58. coroutine.resume(coroutine.create(function()
  59. wait(delay)
  60. sc:remove()
  61. end))
  62. end
  63. if char:findFirstChild("Bricks",true) then
  64. char:findFirstChild("Bricks",true):remove()
  65. end
  66. bricks = Instance.new("Model",me.Character)
  67. bricks.Name = "Bricks"
  68. --Parts-------------------------Parts-------------------------Parts-------------------------Parts----------------------
  69. rarm = char:findFirstChild("Right Arm")
  70. larm = char:findFirstChild("Left Arm")
  71. lleg = char:findFirstChild("Left Leg")
  72. torso = char:findFirstChild("Torso")
  73. hum = char:findFirstChild("Humanoid")
  74. righthold = Instance.new("Part")
  75. prop(righthold, bricks, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
  76. w11 = Instance.new("Weld")
  77. weld(w11, rarm, righthold, 0, 0, 0, 0, 1, 0)
  78. lefthold = Instance.new("Part")
  79. prop(lefthold, bricks, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
  80. w12 = Instance.new("Weld")
  81. weld(w12, larm, lefthold, 0, 0, 0, 0, 1, 0)
  82. hold = Instance.new("Part")
  83. prop(hold, bricks, false, 0, 0, 0.2, 0.4, 0.7, "Black", false, "Custom")
  84. oh = Instance.new("Weld")
  85. weld(oh, lleg, hold, -math.pi/1.4, 0, math.rad(35), 0.55, -0.9, 0.3)
  86. knife = Instance.new("Part")
  87. prop(knife, bricks, false, 0, 0, 0.35, 1.1, 0.5, "Reddish brown", false, "Custom")
  88. orr = Instance.new("Weld")
  89. weld(orr, hold, knife, 0, 0, 0, 0, 0.7, 0)
  90. ar = Instance.new("Weld")
  91. weld(ar, lefthold, nil, math.pi/2, 0, math.pi, 0, 0, 0)
  92. blade = Instance.new("Part")
  93. prop(blade, bricks, false, 0, 0, 0.1, 1.5, 0.4, "Medium grey", false, "Custom")
  94. Instance.new("BlockMesh",blade).Scale = Vector3.new(0.3,1,1)
  95. w2 = Instance.new("Weld")
  96. weld(w2, knife, blade, 0, 0, 0, 0, -1.2, 0)
  97. blade2 = Instance.new("Part")
  98. prop(blade2, bricks, false, 0, 0, 0.1, 0.5, 0.4, "Medium grey", false, "Custom")
  99. local mew = Instance.new("SpecialMesh",blade2)
  100. mew.MeshType = "Wedge"
  101. mew.Scale = Vector3.new(0.3,1,1)
  102. w3 = Instance.new("Weld")
  103. weld(w3, blade, blade2, 0, 0, 0, 0, -1, 0)
  104. rb = Instance.new("Part")
  105. prop(rb, bricks, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
  106. w13 = Instance.new("Weld")
  107. weld(w13, torso, rb, 0, 0, 0, -1.5, -0.5, 0)
  108. lb = Instance.new("Part")
  109. prop(lb, bricks, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
  110. w14 = Instance.new("Weld")
  111. weld(w14, torso, lb, 0, 0, 0, 1.5, -0.5, 0)
  112. rw = Instance.new("Weld")
  113. weld(rw, rb, nil, 0, 0, 0, 0, 0.5, 0)
  114. lw = Instance.new("Weld")
  115. weld(lw, lb, nil, 0, 0, 0, 0, 0.5, 0)
  116. grabweld = nil
  117. platlol = nil
  118. lolhum = nil
  119. function touch(h)
  120. if hurt then
  121. if grabbed == nil then
  122. local hu = h.Parent:findFirstChild("Humanoid")
  123. local head = h.Parent:findFirstChild("Head")
  124. local torz = h.Parent:findFirstChild("Torso")
  125. if hu ~= nil and head ~= nil and torz ~= nil and h.Parent.Name ~= name then
  126. if hu.Health > 0 then
  127. grabbed = torz
  128. hu.PlatformStand = true
  129. local w = Instance.new("Weld")
  130. weld(w,righthold,grabbed,math.pi/2,0.2,0,0.7,-0.9,-0.6)
  131. grabweld = w
  132. lolhum = hu
  133. local lolxd = true
  134. platlol = lolxd
  135. hu.Changed:connect(function(prop)
  136. if prop == "PlatformStand" and platlol then
  137. hu.PlatformStand = true
  138. end
  139. end)
  140. end
  141. end
  142. end
  143. end
  144. end
  145. righthold.Touched:connect(touch)
  146. lefthold.Touched:connect(touch)
  147. function bleed(part,po)
  148. local lol1 = math.random(5,30)/100
  149. local lol2 = math.random(5,30)/100
  150. local lol3 =math.random(5,30)/100
  151. local lol4 = math.random(1,#bloodcolors)
  152. local p = Instance.new("Part")
  153. prop(p,part.Parent,false,0,0,lol1,lol2,lol3,bloodcolors[lol4],false,"Custom")
  154. p.CFrame = part.CFrame * CFrame.new(math.random(-5,5)/10,po,math.random(-5,5)/10)
  155. p.Velocity = Vector3.new(math.random(-190,190)/10,math.random(-190,190)/10,math.random(-190,190)/10)
  156. p.RotVelocity = Vector3.new(math.random(-400,400)/10,math.random(-400,400)/10,math.random(-400,400)/10)
  157. coroutine.resume(coroutine.create(function()
  158. wait(3)
  159. p:remove()
  160. end))
  161. end
  162. if script.Parent.className ~= "HopperBin" then
  163. h = Instance.new("HopperBin",me.Backpack)
  164. h.Name = "Grab"
  165. script.Parent = h
  166. end
  167. bin = script.Parent
  168. function select(mouse)
  169. orr.Part1 = nil
  170. ar.Part1 = knife
  171. mouse.Button1Down:connect(function()
  172. if attacking == false then
  173. attacking = true
  174. lw.Part1 = larm
  175. rw.Part1 = rarm
  176. hurt = true
  177. for i=1, 8 do
  178. rw.C0 = rw.C0 * CFrame.new(-0.03,0,-0.08) * CFrame.fromEulerAnglesXYZ(0.18,0.04,0)
  179. lw.C0 = lw.C0 * CFrame.new(0.06,0,-0.06) * CFrame.fromEulerAnglesXYZ(0.15,-0.11,-0.05)
  180. wait()
  181. end
  182. wait(1)
  183. hurt = false
  184. if grabbed == nil then
  185. for i=1, 4 do
  186. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  187. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.12) * CFrame.fromEulerAnglesXYZ(-0.3,0.22,0.05)
  188. wait()
  189. end
  190. lw.C0 = CFrame.new(0,0,0)
  191. rw.C0 = CFrame.new(0,0,0)
  192. lw.Part1 = nil
  193. rw.Part1 = nil
  194. attacking = false
  195. end
  196. elseif hurt == false and grabbed ~= nil and mode == "drop" then
  197. grabweld:remove()
  198. grabweld = nil
  199. platlol = false
  200. grabbed = nil
  201. lolhum.PlatformStand = false
  202. lolhum = nil
  203. for i=1, 4 do
  204. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  205. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.3,0.2,0)
  206. wait()
  207. end
  208. lw.C0 = CFrame.new(0,0,0)
  209. rw.C0 = CFrame.new(0,0,0)
  210. lw.Part1 = nil
  211. rw.Part1 = nil
  212. attacking = false
  213. platlol = nil
  214. elseif hurt == false and grabbed ~= nil and grabweld ~= nil and mode == "throw" then
  215. grabweld:remove()
  216. grabweld = nil
  217. local bf = Instance.new("BodyForce",grabbed)
  218. bf.force = torso.CFrame.lookVector * 8500
  219. bf.force = bf.force + Vector3.new(0,7400,0)
  220. coroutine.resume(coroutine.create(function()
  221. wait(0.12)
  222. bf:remove()
  223. end))
  224. for i=1, 6 do
  225. rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.35,0,0)
  226. lw.C0 = lw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.18,0,0)
  227. wait()
  228. end
  229. for i=1, 4 do
  230. rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.47,0,0)
  231. lw.C0 = lw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.2,0,0)
  232. wait()
  233. end
  234. wait(0.2)
  235. platlol = false
  236. grabbed = nil
  237. lolhum.PlatformStand = false
  238. lolhum = nil
  239. for i=1, 4 do
  240. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  241. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.3,0.2,0)
  242. wait()
  243. end
  244. lw.C0 = CFrame.new(0,0,0)
  245. rw.C0 = CFrame.new(0,0,0)
  246. lw.Part1 = nil
  247. rw.Part1 = nil
  248. attacking = false
  249. platlol = nil
  250. elseif hurt == false and grabbed ~= nil and lolhum ~= nil and grabweld ~= nil and mode == "kill" then
  251. for i=1, 5 do
  252. lw.C0 = lw.C0 * CFrame.new(0.02,0.12,0.1) * CFrame.fromEulerAnglesXYZ(-0.05,0,-0.03)
  253. wait()
  254. end
  255. local ne = grabbed:findFirstChild("Neck")
  256. coroutine.resume(coroutine.create(function()
  257. local duh = grabbed
  258. local duh2 = grabbed.Parent.Head
  259. local lolas = lolhum
  260. duh.RotVelocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  261. for i=1, 60 do
  262. wait()
  263. local hm = math.random(1,9)
  264. pcall(function()
  265. if hm == 1 then
  266. duh2.Sound.Pitch = math.random(90,110)/100
  267. duh2.Sound:play()
  268. end
  269. end)
  270. if hm > 0 and hm < 3 then
  271. bleed(duh,1)
  272. bleed(duh2,-0.5)
  273. end
  274. end
  275. lolas.Health = 0
  276. for i=1, 85 do
  277. wait()
  278. local hm = math.random(1,9)
  279. pcall(function()
  280. if hm == 1 then
  281. duh2.Sound.Pitch = math.random(90,110)/100
  282. duh2.Sound:play()
  283. end
  284. end)
  285. if hm > 0 and hm < 3 then
  286. bleed(duh,1)
  287. bleed(duh2,-0.5)
  288. end
  289. end
  290. end))
  291. for i=1, 3 do
  292. lw.C0 = lw.C0 * CFrame.new(0.02,0.12,0.1) * CFrame.fromEulerAnglesXYZ(-0.05,0,-0.03)
  293. if ne ~= nil then
  294. grabbed.Neck.C0 = grabbed.Neck.C0 * CFrame.fromEulerAnglesXYZ(-0.35,0,0)
  295. end
  296. wait()
  297. end
  298. grabweld:remove()
  299. grabweld = nil
  300. for i=1, 4 do
  301. lw.C0 = lw.C0 * CFrame.new(-0.04,-0.24,-0.2) * CFrame.fromEulerAnglesXYZ(0.1,0,0.06)
  302. wait()
  303. end
  304. for i=1, 4 do
  305. rw.C0 = rw.C0 * CFrame.new(0.06,0,0.16) * CFrame.fromEulerAnglesXYZ(-0.36,-0.08,0)
  306. lw.C0 = lw.C0 * CFrame.new(-0.12,0,0.12) * CFrame.fromEulerAnglesXYZ(-0.3,0.22,0.05)
  307. wait()
  308. end
  309. lw.C0 = CFrame.new(0,0,0)
  310. rw.C0 = CFrame.new(0,0,0)
  311. lw.Part1 = nil
  312. rw.Part1 = nil
  313. platlol = false
  314. grabbed = nil
  315. lolhum = nil
  316. attacking = false
  317. platlol = nil
  318. end
  319. end)
  320. mouse.KeyDown:connect(function(kai)
  321. key = kai:lower()
  322. if key == "q" then
  323. mode = "drop"
  324. inform("Mode: Drop",2)
  325. elseif key == "e" then
  326. mode = "throw"
  327. inform("Mode: Throw",2)
  328. elseif key == "f" then
  329. mode = "kill"
  330. inform("Mode: Kill",2)
  331. end
  332. end)
  333. end
  334. function desel()
  335. repeat wait() until attacking == false
  336. orr.Part1 = knife
  337. ar.Part1 = nil
  338. end
  339. bin.Selected:connect(select)
  340. bin.Deselected:connect(desel)
  341. char.Humanoid.Died:connect(function()
  342. pcall(function()
  343. grabweld:remove()
  344. grabweld = nil
  345. grabbed = nil
  346. platlol = false
  347. platlol = nil
  348. end)
  349. end)
  350. inform("Grab script loaded succesfully.",2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement