JerryTheUnicorn1

sword knife thing XD

Jan 1st, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.71 KB | None | 0 0
  1. pcall(function()
  2. local players = game:GetService("Players")
  3. local workspac = game:GetService("Workspace")
  4. Me = players.LocalPlayer
  5. Me.Character.Humanoid.Health = math.huge
  6. char = Me.Character
  7. name = Me.Name
  8. Torso = char.Torso
  9. Rarm = char["Right Arm"]
  10. Larm = char["Left Arm"]
  11. local Atk = false
  12.  
  13. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  14. part.Parent = parent
  15. part.formFactor = form
  16. part.CanCollide = collide
  17. part.Transparency = tran
  18. part.Reflectance = ref
  19. part.Size = Vector3.new(x,y,z)
  20. part.BrickColor = BrickColor.new(color)
  21. part.TopSurface = 0
  22. part.BottomSurface = 0
  23. part.Anchored = anchor
  24. part.Locked = true
  25. part:BreakJoints()
  26. end
  27. function mesh(mesh, parent, x, y, z, type)
  28. mesh.Parent = parent
  29. mesh.Scale = Vector3.new(x, y, z)
  30. if mesh.className == "SpecialMesh" then
  31. mesh.MeshType = type
  32. end
  33. end
  34. function wel(weld, x, y, z, parent, part, parta, xx, yy, zz)
  35. local wel = weld
  36. wel.Parent = parent
  37. wel.Part0 = part
  38. wel.Part1 = parta
  39. wel.C1 = CFrame.new(x, y, z) * CFrame.Angles(xx, yy, zz)
  40. end
  41.  
  42. pcall(function() char["Prt2"]:remove() end)
  43. pcall(function() char["Prt1"]:remove() end)
  44.  
  45. local Model = Instance.new("Model",char)
  46. Model.Name = "Prt2"
  47. local Model2 = Instance.new("Model",char)
  48. Model2.Name = "Prt1"
  49.  
  50. local RAB = Instance.new("Part")
  51. RAB.formFactor = "Custom"
  52. RAB.Size = Vector3.new(0.2, 0.2, 0.2)
  53. RAB.Transparency = 1
  54. RAB.Parent = Model
  55. RAB:BreakJoints()
  56.  
  57. local RABW = Instance.new("Weld",RAB)
  58. RABW.Part0 = Torso
  59. RABW.Part1 = RAB
  60. RABW.C1 = CFrame.new(-1.5, -0.5, 0)
  61.  
  62. local LAB = Instance.new("Part")
  63. LAB.formFactor = "Custom"
  64. LAB.Size = Vector3.new(0.2, 0.2, 0.2)
  65. LAB.Transparency = 1
  66. LAB.Parent = Model
  67. LAB:BreakJoints()
  68.  
  69. local LABW = Instance.new("Weld",LAB)
  70. LABW.Part0 = Torso
  71. LABW.Part1 = LAB
  72. LABW.C1 = CFrame.new(1.5, -0.5, 0)
  73.  
  74. local RAW = Instance.new("Weld",RAB)
  75. RAW.Part0 = RAB
  76. RAW.Part1 = nil
  77. RAW.C1 = CFrame.new(0, 0.5, 0)
  78.  
  79. local LAW = Instance.new("Weld",LAB)
  80. LAW.Part0 = LAB
  81. LAW.Part1 = nil
  82. LAW.C1 = CFrame.new(0, 0.5, 0)
  83.  
  84. local shaft = Instance.new("Part")
  85. prop(shaft, Model2, false, 0, 0, 0.2, 3, 0.2, "White", false, "Custom")
  86. local shaftm = Instance.new("BlockMesh")
  87. mesh(shaftm, shaft, 1, 1, 0.25)
  88. local shaftw = Instance.new("Weld")
  89. wel(shaftw, -0.65, 0.65, 0.5, shaft, shaft, Torso, 0, 0, 0.75)
  90. local handle = Instance.new("Part")
  91. prop(handle, Model2, false, 0, 0, 0.35, 0.2, 0.35, "Really black", false, "Custom")
  92. local handlem = Instance.new("BlockMesh")
  93. mesh(handlem, handle, 1, 1, 1)
  94. local handlew = Instance.new("Weld")
  95. wel(handlew, 0, -1.5, 0, handle, handle, shaft, 0, 0, 0)
  96. local handle2 = Instance.new("Part")
  97. prop(handle2, Model2, false, 0, 0, 0.3, 1, 0.3, "Really black", false, "Custom")
  98. local handle2m = Instance.new("BlockMesh")
  99. mesh(handle2m, handle2, 1, 1, 1)
  100. local handle2w = Instance.new("Weld")
  101. wel(handle2w, 0, -0.45, 0, handle2, handle2, handle, 0, 0, 0)
  102.  
  103. function bleed(obj)
  104. for i = 1, math.random(5, 7) do
  105. dis = math.random(0.25, 0.65)
  106. part = Instance.new("Part", workspac)
  107. part.CanCollide = false
  108. part.Anchored = false
  109. part.formFactor = "Custom"
  110. part.BrickColor = BrickColor.new("Really red")
  111. part.TopSurface = "Smooth"
  112. part.BottomSurface = "Smooth"
  113. part.Size = Vector3.new(dis, dis, 0.2)
  114. part.CFrame = obj.CFrame + Vector3.new(math.random(-1.5, 1.5), math.random(-0.5, 0.5), math.random(-1.5, 1.5))
  115. part:BreakJoints()
  116. coroutine.resume(coroutine.create(function()
  117. wait(math.random(0.5, 0.75))
  118. part:remove()
  119. end))
  120. end
  121. end
  122.  
  123. function eft(part, time)
  124. local pst = part:clone()
  125. pst.Parent = workspace
  126. pst.Anchored = true
  127. pst.Size = part.Size
  128. pst.CFrame = part.CFrame
  129. pst.CanCollide = false
  130. pst.Transparency = 0.5
  131. coroutine.resume(coroutine.create(function()
  132. wait(time)
  133. pst:remove()
  134. end))
  135. end
  136.  
  137. function hurt(mag, dmg, part)
  138. for _,v in pairs(workspac:GetChildren()) do
  139. if v.Name ~= name then
  140. if v:findFirstChild("Humanoid") ~= nil and v:findFirstChild("Torso") ~= nil then
  141. if (v.Torso.Position - part.Position).magnitude < mag then
  142. v.Humanoid:TakeDamage(dmg)
  143. bleed(part)
  144. end
  145. end
  146. end
  147. end
  148. end
  149.  
  150. if script.Parent.className ~= "HopperBin" then
  151. local h = Instance.new("HopperBin", Me.Backpack)
  152. h.Name = "Sword"
  153. script.Parent = h
  154. end
  155.  
  156. local bin = script.Parent
  157.  
  158. function onSelected(mouse)
  159. LAW.Part1 = Larm
  160. RAW.Part1 = Rarm
  161. for i = 0, 1, 0.125 do
  162. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-22.5*i), 0, math.rad(12.5*i))
  163. wait()
  164. end
  165. for i = 0, 1, 0.125 do
  166. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad((-22.5)+(-12.5)*i), 0, math.rad(12.5-35*i))
  167. wait()
  168. end
  169. shaftw.Part1 = Rarm
  170. shaftw.C1 = CFrame.new(-1.75, 0, 0) * CFrame.Angles(0, 0, 1)
  171. for i = 0, 1, 0.125 do
  172. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-35+125*i), 0, math.rad(-22.5+22.5*i))
  173. shaftw.C1 = CFrame.new(-2, -1, 0) * CFrame.Angles(0, 0, 1.55)
  174. wait()
  175. end
  176. mouse.Button1Down:connect(function()
  177. if Atk == false then
  178. Atk = true
  179. for i = 0, 1, 0.15 do
  180. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+0*i), 0, math.rad(140*i))
  181. hurt(2, 7.5, shaft)
  182. eft(shaft, 0.15)
  183. wait()
  184. end
  185. for i = 0, 1, 0.15 do
  186. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+0*i), 0, math.rad(140-140*i))
  187. wait()
  188. end
  189. Atk = false
  190. end
  191. end)
  192. mouse.KeyDown:connect(function(key)
  193. if key == "p" then
  194. if Atk == false then
  195. Atk = true
  196. for i = 0, 1, 0.1 do
  197. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+90*i), math.rad(-90*i), math.rad(0*i))
  198. wait()
  199. end
  200. for i = 0, 1, 0.1 do
  201. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(180-50*i), math.rad(-90+0*i), math.rad(0*i))
  202. hurt(2, 7.5, shaft)
  203. wait()
  204. end
  205. for i = 0, 1, 0.1 do
  206. shaftw.C1 = CFrame.new(-2, math.rad(-1000*i), 0) * CFrame.Angles(0, 0, math.rad(1000*i))
  207. hurt(3, 22.5, shaft)
  208. wait()
  209. end
  210. for i = 0, 1, 0.1 do
  211. shaftw.C1 = CFrame.new(-2, math.rad(-1000+1000*i), 0) * CFrame.Angles(0, 0, math.rad(1000-1000*i))
  212. hurt(3, 22.5, shaft)
  213. wait()
  214. end
  215. shaftw.C1 = CFrame.new(-2, -1, 0) * CFrame.Angles(0, 0, 1.55)
  216. for i = 0, 1, 0.1 do
  217. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0+90*i), math.rad(-90+90*i), math.rad(0*i))
  218. wait()
  219. end
  220. Atk = false
  221. end
  222. end
  223. if key == "x" then
  224. if Atk == false then
  225. Atk = true
  226. for i = 0, 1, 0.1 do
  227. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(200+45*i), math.rad(-90*i), math.rad(0*i))
  228. wait()
  229. end
  230. for i = 0, 1, 0.1 do
  231. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(200-140*i), math.rad(-90+0*i), math.rad(0*i))
  232. hurt(2, 7.5, shaft)
  233. wait()
  234. end
  235. for i = 0, 1, 0.1 do
  236. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(10+100*i), math.rad(-90+90*i), math.rad(0*i))
  237. wait()
  238. end
  239. Atk = false
  240. end
  241. end
  242. if key == "q" then
  243. if Atk == false then
  244. Atk = true
  245. for i = 0, 1, 0.1 do
  246. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+45*i), math.rad(-90*i), math.rad(0*i))
  247. wait()
  248. end
  249. for i = 0, 1, 0.1 do
  250. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(135-125*i), math.rad(-90+0*i), math.rad(0*i))
  251. hurt(2, 7.5, shaft)
  252. wait()
  253. end
  254. for i = 0, 1, 0.1 do
  255. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(10+80*i), math.rad(-90+90*i), math.rad(0*i))
  256. wait()
  257. end
  258. Atk = false
  259. end
  260. end
  261. if key == "e" then
  262. if Atk == false then
  263. Atk = true
  264. for i = 0, 1, 0.1 do
  265. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+90*i), math.rad(-90*i), math.rad(0*i))
  266. wait()
  267. end
  268. for i = 0, 1, 0.1 do
  269. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(180-90*i), math.rad(-90+0*i), math.rad(0*i))
  270. hurt(2, 7.5, shaft)
  271. wait()
  272. end
  273. for i = 0, 1, 0.1 do
  274. shaftw.C1 = CFrame.new(-2, math.rad(-1000*i), 0) * CFrame.Angles(0, 0, math.rad(1000*i))
  275. hurt(3, 22.5, shaft)
  276. wait()
  277. end
  278. for i = 0, 1, 0.1 do
  279. shaftw.C1 = CFrame.new(-2, math.rad(-1000+1000*i), 0) * CFrame.Angles(0, 0, math.rad(1000-1000*i))
  280. hurt(3, 22.5, shaft)
  281. wait()
  282. end
  283. shaftw.C1 = CFrame.new(-2, -1, 0) * CFrame.Angles(0, 0, 1.55)
  284. for i = 0, 1, 0.1 do
  285. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0+90*i), math.rad(-90+90*i), math.rad(0*i))
  286. wait()
  287. end
  288. Atk = false
  289. end
  290. end
  291. if key == "b" then
  292. if Atk == false then
  293. Atk = true
  294. for i = 0, 1, 0.1 do
  295. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(70+0*i), math.rad(-10*i), math.rad(0*i))
  296. wait()
  297. end
  298. for i = 0, 1, 0.15 do
  299. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(50+0*i), math.rad(-90+420*i), math.rad(0*i))
  300. hurt(2, 7.5, shaft)
  301. eft(shaft, 0.1)
  302. wait()
  303. end
  304. for i = 0, 1, 0.15 do
  305. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(30+0*i), math.rad(360-400*i), math.rad(0*i))
  306. hurt(2, 7.5, shaft)
  307. eft(shaft, 0.1)
  308. wait()
  309. end
  310. for i = 0, 1, 0.1 do
  311. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(10+0*i), math.rad(-60+30*i), math.rad(0*i))
  312. wait()
  313. end
  314. Atk = false
  315. end
  316. end
  317. if key == "f" then
  318. if Atk == false then
  319. Atk = true
  320. for i = 0, 1, 0.1 do
  321. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+0*i), math.rad(-90*i), math.rad(0*i))
  322. wait()
  323. end
  324. for i = 0, 1, 0.15 do
  325. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+0*i), math.rad(-90+450*i), math.rad(0*i))
  326. hurt(2, 7.5, shaft)
  327. eft(shaft, 0.1)
  328. wait()
  329. end
  330. for i = 0, 1, 0.15 do
  331. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+0*i), math.rad(360-450*i), math.rad(0*i))
  332. hurt(2, 7.5, shaft)
  333. eft(shaft, 0.1)
  334. wait()
  335. end
  336. for i = 0, 1, 0.1 do
  337. RAW.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90+0*i), math.rad(-90+90*i), math.rad(0*i))
  338. wait()
  339. end
  340. Atk = false
  341. end
  342. end
  343. end)
  344. end
  345.  
  346. function onDesel(mouse)
  347. shaftw.Part1 = Torso
  348. shaftw.C1 = CFrame.new(-0.65, 0.65, 0.5) * CFrame.Angles(0, 0, 0.75)
  349. RAW.Part1 = nil
  350. LAW.Part1 = nil
  351. end
  352.  
  353. bin.Selected:connect(onSelected)
  354. bin.Deselected:connect(onDesel)
  355. end)
Add Comment
Please, Sign In to add comment