Advertisement
Hebablazin

Ax Of The Night

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