Advertisement
memberhero

Untitled

May 8th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.24 KB | None | 0 0
  1. Plrs = game:GetService("Players")
  2.  
  3. Name = "memberhero"
  4. me = Plrs[Name]
  5. char = me.Character
  6. Modelname = "Ax of night"
  7. Toolname = "Ax of night"
  8. Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"}
  9. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  10. selected = false
  11. Hurt = false
  12. Able = true
  13.  
  14. Add = {
  15. Sphere = function(P)
  16. local m = Instance.new("SpecialMesh",P)
  17. m.MeshType = "Sphere"
  18. return m
  19. end,
  20. BF = function(P)
  21. local bf = Instance.new("BodyForce",P)
  22. bf.force = Vector3.new(0, P:GetMass()*187, 0)
  23. return bf
  24. end,
  25. BP = function(P)
  26. local bp = Instance.new("BodyPosition",P)
  27. bp.maxForce = Vector3.new(math.huge, 0, math.huge)
  28. bp.P = 14000
  29. return bp
  30. end,
  31. BG = function(P)
  32. local bg = Instance.new("BodyGyro",P)
  33. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  34. bg.P = 14000
  35. return bg
  36. end,
  37. Mesh = function(P, ID, x, y, z)
  38. local m = Instance.new("SpecialMesh")
  39. m.MeshId = ID
  40. m.Scale = Vector3.new(x, y, z)
  41. m.Parent = P
  42. return m
  43. end,
  44. Sound = function(P, ID, vol, pitch)
  45. local s = Instance.new("Sound")
  46. s.SoundId = ID
  47. s.Volume = vol
  48. s.Pitch = pitch
  49. s.Parent = P
  50. return s
  51. end
  52. }
  53.  
  54. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  55. local p = Instance.new("Part")
  56. p.formFactor = "Custom"
  57. p.Anchored = Anchor
  58. p.CanCollide = Collide
  59. p.Transparency = Tran
  60. p.Reflectance = Ref
  61. p.BrickColor = BrickColor.new(Color)
  62. for _, Surf in pairs(Surfaces) do
  63. p[Surf] = "Smooth"
  64. end
  65. p.Size = Vector3.new(X, Y, Z)
  66. if Break then
  67. p:BreakJoints()
  68. else p:MakeJoints() end
  69. p.Parent = Parent
  70. return p
  71. end
  72.  
  73. function Weld(p0, p1, x, y, z, a, b, c)
  74. local w = Instance.new("Weld")
  75. w.Parent = p0
  76. w.Part0 = p0
  77. w.Part1 = p1
  78. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  79. return w
  80. end
  81.  
  82. function ComputePos(pos1, pos2)
  83. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  84. return CFrame.new(pos1, pos3)
  85. end
  86.  
  87. function getHumanoid(c)
  88. local h = nil
  89. for i,v in pairs(c:children()) do
  90. if v:IsA("Humanoid") and c ~= char then
  91. if v.Health > 0 then
  92. h = v
  93. end
  94. end
  95. end
  96. return h
  97. end
  98.  
  99. for i,v in pairs(char:children()) do
  100. if v.Name == Modelname then
  101. v:remove()
  102. end
  103. end
  104.  
  105. torso = char.Torso
  106. neck = torso.Neck
  107. hum = char.Humanoid
  108. Rarm = char["Right Arm"]
  109. Larm = char["Left Arm"]
  110. Rleg = char["Right Leg"]
  111. Lleg = char["Left Leg"]
  112.  
  113. hc = Instance.new("Humanoid")
  114. hc.Health = 0
  115. hc.MaxHealth = 0
  116.  
  117. slash = Add.Sound(nil, "rbxasset://sounds//swordslash.wav", 0.9, 1)
  118. hitsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2801263", 0.7, 0.6)
  119. charge = Add.Sound(nil, "http://www.roblox.com/asset/?id=2101137", 0.8, 0.65)
  120. boom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2691586", 0.8, 0.3)
  121.  
  122. function PlaySound(sound)
  123. local s = sound:clone()
  124. s.Parent = torso
  125. s.PlayOnRemove = true
  126. coroutine.resume(coroutine.create(function()
  127. wait()
  128. s:remove()
  129. end))
  130. end
  131.  
  132.  
  133. --[[ PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS
  134. PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS
  135. PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS PARTS
  136. ]]
  137. Mo = Instance.new("Model")
  138. Mo.Name = Modelname
  139.  
  140. RABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  141. LABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  142. RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  143. LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  144.  
  145. RABW = Weld(torso, RABrick, -1.5, -0.5, 0, 0, 0, 0)
  146. LABW = Weld(torso, LABrick, 1.5, -0.5, 0, 0, 0, 0)
  147. RLBW = Weld(torso, RLBrick, -0.5, 1.2, 0, 0, 0, 0)
  148. LLBW = Weld(torso, LLBrick, 0.5, 1.2, 0, 0, 0, 0)
  149.  
  150. RAW = Weld(RABrick, nil, 0, 0.5, 0, 0, 0, 0)
  151. LAW = Weld(LABrick, nil, 0, 0.5, 0, 0, 0, 0)
  152. RLW = Weld(RLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  153. LLW = Weld(LLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  154.  
  155. HB = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  156. HBW = Weld(Rarm, HB, 0, 1, 0, 0, 0, 0)
  157. HW = Weld(HB, nil, 0, -1, 0, math.pi/2, 0, 0)
  158.  
  159. TH = Weld(torso, nil, -0.75, 0.7, 0.4, 0, math.pi/2, math.rad(-140))
  160. TH.C0 = CFrame.Angles(math.rad(-10), math.rad(10), 0)
  161.  
  162. handle = Part(Mo, false, false, 0, 0, "Black", 0.5, 6, 0.5, true)
  163. Instance.new("SpecialMesh",handle)
  164. handle.Name = "Handle"
  165.  
  166. dec1 = Part(Mo, false, false, 0, 0, "Dark grey", 0.2, 4, 0.2, true)
  167. Add.Mesh(dec1, "http://www.roblox.com/asset/?id=16606212", 0.27, 0.27, 1.45)
  168. Weld(handle, dec1, 0, 0, 0, math.pi/2, 0, 0)
  169.  
  170. dec2 = Part(Mo, false, false, 0, 0, "White", 0.8, 0.8, 0.3, true)
  171. Add.Mesh(dec2, "http://www.roblox.com/asset/?id=4770583", 2, 2.5, 1.1)
  172. Weld(handle, dec2, 0, -2.7, 0, 0, math.pi/2, 0)
  173.  
  174. for x = 0, 180, 180 do
  175. for i = -60, 70, 130/4 do
  176. local asd = (i+120)/85
  177. local p = Part(Mo, false, false, 0, 0, "Dark grey", 0.3, 0.8, 0.3, true)
  178. Add.Mesh(p, "http://www.roblox.com/asset/?id=1033714", 0.16, asd, 0.16)
  179. local w = Weld(dec2, p, 0, 0, 0, 0, 0, 0)
  180. w.C0 = CFrame.Angles(0, math.rad(x), math.rad(i))
  181. w.C1 = CFrame.new(0, -0.7, 0) * CFrame.Angles(math.pi/2, math.pi/2, 0)
  182. end
  183. end
  184.  
  185. mainspike = Part(Mo, false, false, 0, 0, "Medium grey", 0.3, 0.8, 0.3, true)
  186. Add.Mesh(mainspike, "http://www.roblox.com/asset/?id=1033714", 0.17, 3, 0.17)
  187. Weld(dec2, mainspike, 0, -1.5, 0, 0, 0, 0)
  188.  
  189. blade = Part(Mo, false, false, 0, 0, "Medium grey", 3, 0.7, 0.2, true)
  190. Weld(dec2, blade, 0, 0.4, 0, 0, 0, 0)
  191. Instance.new("BlockMesh",blade).Scale = Vector3.new(1, 1, 0.4)
  192.  
  193. for i = 0, 180, 180 do
  194. for x = -45, 45, 90/6 do
  195. local p = Part(Mo, false, false, 0, 0, "Medium grey", 0.6, 0.6, 0.2, true)
  196. Instance.new("BlockMesh",p).Scale = Vector3.new(1, 1, 0.9)
  197. local w = Weld(blade, p, 0, 0, 0, 0, 0, 0)
  198. w.C0 = CFrame.Angles(0, math.rad(i), 0) * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(x))
  199. w.C1 = CFrame.new(-1.8, 0, 0)
  200. end
  201. for x = 0, -180, -90/4 do
  202. local p = Part(Mo, false, false, 0, 0, "Medium grey", 0.6, 0.6, 0.2, true)
  203. Instance.new("BlockMesh",p).Scale = Vector3.new(1, 1, 0.4)
  204. local w = Weld(blade, p, 0, 0, 0, 0, 0, 0)
  205. w.C0 = CFrame.new(0, -1.32, 0) * CFrame.Angles(0, 0, math.rad(x))
  206. w.C1 = CFrame.new(1.05, 0, 0)
  207. end
  208. for x = 0, 180, 90/4 do
  209. local p = Part(Mo, false, false, 0, 0, "Medium grey", 0.6, 0.6, 0.2, true)
  210. Instance.new("BlockMesh",p).Scale = Vector3.new(1, 1, 0.4)
  211. local w = Weld(blade, p, 0, 0, 0, 0, 0, 0)
  212. w.C0 = CFrame.new(0, 1.32, 0) * CFrame.Angles(0, 0, math.rad(x))
  213. w.C1 = CFrame.new(1.05, 0, 0)
  214. end
  215. end
  216.  
  217. for x = 0, 180, 180 do
  218. for y = 0, 180, 180 do
  219. local p = Part(Mo, false, false, 0, 0, "Medium grey", 1, 1, 0.2, true)
  220. Instance.new("BlockMesh",p).Scale = Vector3.new(1, 1, 0.4)
  221. local w = Weld(blade, p, 0, 0, 0, 0, 0, 0)
  222. w.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(x), 0, math.rad(y))
  223. w.C1 = CFrame.new(-1.2, -0.5, 0)
  224. end
  225. end
  226.  
  227. handletip1 = Part(Mo, false, false, 0, 0.2, "Really black", 0.5, 0.5, 0.5, true)
  228. w1 = Weld(handle, handletip1, 0, 0, 0, 0, 0, 0)
  229. w1.C0 = CFrame.new(0, -2.9, 0)
  230. Add.Mesh(handletip1, "http://www.roblox.com/asset/?id=9756362", 0.8, 0.7, 0.8)
  231.  
  232. handletip2 = Part(Mo, false, false, 0, 0.2, "Dark grey", 0.5, 0.5, 0.5, true)
  233. Weld(handletip1, handletip2, 0, 0, 0, 0, math.rad(45), 0)
  234. Add.Mesh(handletip2, "http://www.roblox.com/asset/?id=9756362", 0.85, 0.55, 0.85)
  235.  
  236. Mo.Parent = char
  237. TH.Part1 = handle
  238.  
  239. if script.Parent.className ~= "HopperBin" then
  240. h = Instance.new("HopperBin",me.Backpack)
  241. h.Name = Toolname
  242. script.Parent = h
  243. end
  244.  
  245. bin = script.Parent
  246.  
  247. --[[ ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS
  248. ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS
  249. ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS ANIMATIONS
  250. ]]
  251.  
  252. RAWStand, LAWStand, RLWStand, LLWStand, HWStand = nil
  253.  
  254.  
  255. function detach(bool)
  256. LLW.C0 = CFrame.new(0, 0, 0)
  257. RLW.C0 = CFrame.new(0, 0, 0)
  258. LAW.C0 = CFrame.new(0, 0, 0)
  259. RAW.C0 = CFrame.new(0, 0, 0)
  260. if bool then
  261. LLW.Part1 = nil
  262. RLW.Part1 = nil
  263. RAW.Part1 = nil
  264. LAW.Part1 = nil
  265. TH.Part1 = handle
  266. HW.Part1 = nil
  267. end
  268. end
  269.  
  270. function attach()
  271. RAW.Part1 = Rarm
  272. LAW.Part1 = Larm
  273. RLW.Part1 = Rleg
  274. LLW.Part1 = Lleg
  275. end
  276.  
  277. function normal()
  278. neck.C0 = necko
  279. RAW.C0 = RAWStand
  280. LAW.C0 = LAWStand
  281. RLW.C0 = RLWStand
  282. LLW.C0 = LLWStand
  283. HW.C0 = HWStand
  284. end
  285.  
  286. function idleanim()
  287. attach()
  288. for i = 0, 1, 0.015 do
  289. RAW.C0 = RAWStand * CFrame.Angles(math.rad(-3*i), math.rad(8*i), 0)
  290. LAW.C0 = LAWStand * CFrame.Angles(math.rad(-16*i), 0, 0)
  291. RLW.C0 = RLWStand * CFrame.Angles(math.rad(-4*i), 0, math.rad(3*i))
  292. LLW.C0 = LLWStand * CFrame.Angles(math.rad(4*i), 0, math.rad(-3*i))
  293. neck.C0 = necko * CFrame.Angles(math.rad(7*i), 0, math.rad(6*i))
  294. if selected == false or torso.Velocity.magnitude > 4 or Able == false then break end
  295. wait()
  296. end
  297. wait()
  298. for i = 1, 0, -0.011 do
  299. RAW.C0 = RAWStand * CFrame.Angles(math.rad(-3*i), math.rad(8*i), 0)
  300. LAW.C0 = LAWStand * CFrame.Angles(math.rad(-16*i), 0, 0)
  301. RLW.C0 = RLWStand * CFrame.Angles(math.rad(-4*i), 0, math.rad(3*i))
  302. LLW.C0 = LLWStand * CFrame.Angles(math.rad(4*i), 0, math.rad(-3*i))
  303. neck.C0 = necko * CFrame.Angles(math.rad(7*i), 0, math.rad(6*i))
  304. if selected == false or torso.Velocity.magnitude > 4 or Able == false then break end
  305. wait()
  306. end
  307. normal()
  308. end
  309.  
  310. function runanim()
  311. RLW.Part1 = nil
  312. LLW.Part1 = nil
  313. end
  314.  
  315. coroutine.resume(coroutine.create(function()
  316. while true do
  317. wait()
  318. if selected and Able == true then
  319. if torso.Velocity.magnitude < 0.1 then
  320. idleanim()
  321. else
  322. runanim()
  323. end
  324. wait()
  325. end
  326. end
  327. end))
  328.  
  329. function selectanim()
  330. RAW.Part1 = Rarm
  331. LLW.Part1 = Lleg
  332. RLW.Part1 = Rleg
  333. for i = 0, 1, 0.2 do
  334. RAW.C0 = CFrame.Angles(math.rad(185*i), math.rad(70*i), 0)
  335. LLW.C0 = CFrame.Angles(math.rad(2*i), 0, math.rad(-5*i))
  336. RLW.C0 = CFrame.Angles(math.rad(-2*i), 0, math.rad(5*i))
  337. neck.C0 = necko * CFrame.Angles(0, 0, math.rad(-40*i))
  338. wait()
  339. end
  340. TH.Part1 = nil
  341. HW.Part1 = handle
  342. HW.C0 = CFrame.Angles(math.rad(40), 0, math.rad(-20))
  343. for i = 0, 1, 0.08 do
  344. RAW.C0 = CFrame.Angles(math.rad(185-110*i), math.rad(70-60*i), math.rad(30*i))
  345. LLW.C0 = CFrame.Angles(math.rad(2-8*i), 0, math.rad(-5-10*i))
  346. RLW.C0 = CFrame.Angles(math.rad(-2+8*i), 0, math.rad(5+10*i))
  347. neck.C0 = necko * CFrame.Angles(math.rad(-15*i), 0, math.rad(-40+35*i))
  348. HW.C0 = CFrame.Angles(math.rad(40-70*i), 0, math.rad(-20+20*i))
  349. wait()
  350. end
  351. LAW.Part1 = Larm
  352. for i = 0, 1, 0.1 do
  353. RAW.C0 = CFrame.Angles(math.rad(185-110-5*i), math.rad(70-60+80*i), math.rad(30-30*i))
  354. LAW.C0 = CFrame.Angles(math.rad(70*i), 0, math.rad(8*i)) * CFrame.new(0.1*i, -0.1*i, 0)
  355. LLW.C0 = CFrame.Angles(math.rad(-6), 0, math.rad(-5-10+10*i))
  356. RLW.C0 = CFrame.Angles(math.rad(6), 0, math.rad(5+10-10*i))
  357. neck.C0 = necko * CFrame.Angles(math.rad(-15+15*i), 0, math.rad(-5+5*i))
  358. HW.C0 = CFrame.Angles(math.rad(-30+30*i), 0, math.rad(-60*i)) * CFrame.new(0, 0, -0.4*i)
  359. wait()
  360. end
  361. if RAWStand == nil then
  362. RAWStand = RAW.C0
  363. LAWStand = LAW.C0
  364. LLWStand = LLW.C0
  365. RLWStand = RLW.C0
  366. HWStand = HW.C0
  367. end
  368. selected = true
  369. end
  370.  
  371. function deselanim()
  372. selected = false
  373. for i = 1, 0, -0.1 do
  374. RAW.C0 = CFrame.Angles(math.rad(185-110-5*i), math.rad(70-60+80*i), math.rad(30-30*i))
  375. LAW.C0 = CFrame.Angles(math.rad(70*i), 0, math.rad(8*i)) * CFrame.new(0.1*i, -0.1*i, 0)
  376. LLW.C0 = CFrame.Angles(math.rad(-6), 0, math.rad(-5-10+10*i))
  377. RLW.C0 = CFrame.Angles(math.rad(6), 0, math.rad(5+10-10*i))
  378. neck.C0 = necko * CFrame.Angles(math.rad(-15+15*i), 0, math.rad(-5+5*i))
  379. HW.C0 = CFrame.Angles(math.rad(-30+30*i), 0, math.rad(-60*i)) * CFrame.new(0, 0, -0.4*i)
  380. wait()
  381. end
  382. LAW.Part1 = nil
  383. for i = 1, 0, -0.08 do
  384. RAW.C0 = CFrame.Angles(math.rad(185-110*i), math.rad(70-60*i), math.rad(30*i))
  385. LLW.C0 = CFrame.Angles(math.rad(2-8*i), 0, math.rad(-5-10*i))
  386. RLW.C0 = CFrame.Angles(math.rad(-2+8*i), 0, math.rad(5+10*i))
  387. neck.C0 = necko * CFrame.Angles(math.rad(-15*i), 0, math.rad(-40+35*i))
  388. HW.C0 = CFrame.Angles(math.rad(40-70*i), 0, math.rad(-20+20*i))
  389. wait()
  390. end
  391. TH.Part1 = handle
  392. HW.Part1 = nil
  393. HW.C0 = CFrame.Angles(math.rad(40), 0, math.rad(-20))
  394. for i = 1, 0, -0.2 do
  395. RAW.C0 = CFrame.Angles(math.rad(185*i), math.rad(70*i), 0)
  396. LLW.C0 = CFrame.Angles(math.rad(2*i), 0, math.rad(-5*i))
  397. RLW.C0 = CFrame.Angles(math.rad(-2*i), 0, math.rad(5*i))
  398. neck.C0 = necko * CFrame.Angles(0, 0, math.rad(-40*i))
  399. wait()
  400. end
  401. detach(true)
  402. end
  403.  
  404. function slash(mp)
  405. attach()
  406. local Orig = torso.CFrame
  407. local bg = Add.BG(torso)
  408. local bp = Add.BP(torso)
  409. bp.position = Orig.p
  410. local CF = ComputePos(Orig.p, mp)
  411. bg.cframe = CF
  412. for i = 0, 1, 0.1 do
  413. wait()
  414. end
  415. normal()
  416. bg:remove()
  417. bp:remove()
  418. end
  419.  
  420. function select(mouse)
  421. selectanim()
  422. mouse.Button1Down:connect(function()
  423. if Able then
  424. Able = false
  425. slash(mouse.Hit.p)
  426. Able = true
  427. end
  428. end)
  429. end
  430.  
  431. function deselect(mouse)
  432. deselanim()
  433. end
  434.  
  435. bin.Selected:connect(select)
  436. bin.Deselected:connect(deselect)
  437. --lego
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement