Advertisement
IAmBW

Axe

Mar 21st, 2015
844
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.15 KB | None | 0 0
  1. local name = "IAmBW"
  2.  
  3. if script.Parent.className ~= "HopperBin" then
  4. h = Instance.new("HopperBin")
  5. h.Parent = game.Players[name].Backpack
  6. h.Name = "Ax"
  7. script.Parent = h
  8. end
  9.  
  10. local ld = game.Players[name].Character:findFirstChild("Axe")
  11. if ld then
  12.     ld:remove()
  13. end
  14.  
  15. local sp = script.Parent
  16. local me = game.Players[name]
  17.  
  18. pcall(function()
  19.     local meow = workspace[name]:GetChildren()
  20.     for i=1, #meow do
  21.         if meow[i].Name == "Axe" then
  22.             meow[i]:remove()
  23.         end
  24.     end
  25. end)
  26.  
  27. axe = Instance.new("Model")
  28. axe.Parent = me.Character
  29. axe.Name = "Axe"
  30.  
  31. -------Arm connects------------------------------------------------------
  32.  
  33. brick1 = Instance.new("Part")
  34. brick1.Parent = axe
  35. brick1.Shape = "Ball"
  36. brick1.Size = Vector3.new(1,1,1)
  37. brick1.Transparency = 1
  38. mesh1 = Instance.new("SpecialMesh")
  39. mesh1.Parent = brick1
  40. mesh1.MeshType = "Sphere"
  41. mesh1.Scale = Vector3.new(1.3,1.3,1.3)
  42. brick2 = brick1:clone()
  43. brick2.Parent = axe
  44.  
  45. torsohold1 = Instance.new("Weld")
  46. torsohold1.Parent = me.Character.Torso
  47. torsohold1.Part0 = torsohold1.Parent
  48. torsohold1.Part1 = brick1
  49. torsohold1.C1 = CFrame.new(-1.5,-0.5,0)
  50.  
  51. torsohold2 = Instance.new("Weld")
  52. torsohold2.Parent = me.Character.Torso
  53. torsohold2.Part0 = torsohold2.Parent
  54. torsohold2.Part1 = brick2
  55. torsohold2.C1 = CFrame.new(1.5,-0.5,0)
  56.  
  57. rightoriginal = CFrame.fromEulerAnglesXYZ(-1.1,-0.7,-0.7) * CFrame.new(0.3,0.6,0.2)
  58. leftoriginal = CFrame.fromEulerAnglesXYZ(-1,0.6,0) * CFrame.new(-0.6,0.3,0.5)
  59.  
  60. rarm = me.Character["Right Arm"]
  61. larm = me.Character["Left Arm"]
  62.  
  63. rw = Instance.new("Weld")
  64. rw.Parent = brick1
  65. rw.Part0 = nil
  66. rw.Part1 = nil
  67. rw.C1 = rightoriginal
  68.  
  69. lw = Instance.new("Weld")
  70. lw.Parent = brick2
  71. lw.Part0 = nil
  72. lw.Part1 = nil
  73. lw.C1 = leftoriginal
  74.  
  75. wephold = Instance.new("Weld")
  76. wephold.Parent = me.Character.Torso
  77. wephold.Part0 = wephold.Parent
  78. wephold.Part1 = nil
  79. wephold.C1 = CFrame.new(0,0,-0.6) * CFrame.fromEulerAnglesXYZ(0,0,-2.5)
  80.  
  81. --Handles------------------------------------------------------------------------
  82.  
  83. function property(part, number, color)
  84. part.Parent = axe
  85. part.formFactor = 0
  86. part.TopSurface = 0
  87. part.BottomSurface = 0
  88. part.Name = "Handle"..number
  89. part.Size = Vector3.new(1,1,1)
  90. part.BrickColor = BrickColor.new(color)
  91. part.CanCollide = false
  92. end
  93.  
  94. function mesh(part, mesh, x, y, z)
  95. mesh.Scale = Vector3.new(x,y,z)
  96. mesh.Parent = part
  97. end
  98.  
  99. function weld(weld, part, part1, a, b, c, x, y, z)
  100. weld.Parent = part
  101. weld.Part0 = weld.Parent
  102. weld.Part1 = part1
  103. weld.C1 = CFrame.fromEulerAnglesXYZ(x,y,z) * CFrame.new(a,b,c)
  104. end
  105.  
  106. mainhandle = Instance.new("Part")
  107. property(mainhandle, 1, "Brown")
  108. mainhandle.Size = Vector3.new(1,4,1)
  109.  
  110. mesha = Instance.new("SpecialMesh")
  111. mesha.MeshType = "Head"
  112. mesh(mainhandle, mesha, 0.4, 1, 0.4)
  113.  
  114. wephold.Part1 = mainhandle
  115.  
  116. handlea = Instance.new("Part")
  117. property(handlea, 2, "Dark metallic")
  118. meshb = Instance.new("CylinderMesh")
  119. mesh(handlea, meshb, 0.85, 0.16, 0.85)
  120.  
  121. troll = {}
  122.  
  123. for i=-0.5, 0.6, 0.47 do
  124. handleb = Instance.new("Part")
  125. property(handleb, 3, "Dark grey metallic")
  126. handleb.Size = Vector3.new(2,1,1)
  127. handleb.CanCollide = true
  128. meshc = Instance.new("SpecialMesh")
  129. meshc.MeshType = "Brick"
  130. mesh(handleb, meshc, 1.5, 0.13, 0.8)
  131. waldy = Instance.new("Weld")
  132. weld(waldy, handlea, handleb, 0, 0, 0, 0, i, 0)
  133. table.insert(troll,handleb)
  134. end
  135.  
  136. handlec = Instance.new("Part")
  137. property(handlec, 4, "Dark metallic")
  138. meshd = Instance.new("SpecialMesh")
  139. mesh(handlec, meshd, 0.52,0.9,0.52)
  140.  
  141. --arm weapon weld-----------------------------------
  142.  
  143. armweld = Instance.new("Weld")
  144. weld(armweld, rarm, nil, 0, 1.1, 1.2, 1.57, 0, 2)
  145.  
  146. --Handle welds--------------------------------------
  147.  
  148. hweld1 = Instance.new("Weld")
  149. weld(hweld1, mainhandle, handlea, 0, -1.35, 0, 1.57, 0, 0)
  150.  
  151. hweld2 = Instance.new("Weld")
  152. weld(hweld2, handlea, handlec, 0, 0, 0, 1.57, 0, 0)
  153.  
  154. --blood effect------------------------------
  155.  
  156. function blood(part)
  157.     for i=1, 4 do
  158.     local b = Instance.new("Part")
  159.     b.Parent = workspace
  160.     b.formFactor = "Plate"
  161.     b.Size = Vector3.new(1,0.4,1)
  162.     b.BrickColor = BrickColor.new(21)
  163.     b.TopSurface = 0
  164.     b.BottomSurface = 0
  165.     b.CanCollide = false
  166.     b.Velocity = Vector3.new(math.random(-20,20),math.random(0,40),math.random(-20,20))
  167.     b.RotVelocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  168.     local m = Instance.new("SpecialMesh")
  169.     m.MeshType = "Brick"
  170.     m.Parent = b
  171.     m.Scale = Vector3.new(0.5,0.4,0.5)
  172.     b.CFrame = CFrame.new(part.Position)
  173.     b.Anchored = false
  174.     b:breakJoints()
  175.     coroutine.resume(coroutine.create(function()
  176.     wait(3)
  177.     b:remove()
  178.     end))
  179.     end
  180. end
  181.  
  182. sele = false
  183. --KILL FUNCTION-------------------------------------------
  184.  
  185. hitting = false
  186. swinging = false
  187.  
  188. troll[2].Touched:connect(function(hit)
  189.     if hitting == false then return end
  190.     local hu = hit.Parent:findFirstChild("Humanoid")
  191.     if hu ~= nil then
  192.         hu.Health = hu.Health - 10
  193.         blood(hit)
  194.     end
  195. end)
  196.  
  197. colors = {"Black", "Bright blue", "Light blue", "Navy blue", "Deep blue", "White"}
  198. numba = #colors
  199.  
  200. function selected(mouse, key)
  201.     sele = true
  202.     coroutine.resume(coroutine.create(function()
  203.         while sele == true do
  204.             wait()
  205.             local koko = math.random(-400.0,400.0)/1000
  206.             local kokoe = math.random(-400.0,400.0)/1000
  207.             local kokoq = math.random(-400.0,400.0)/1000
  208.             local k = Instance.new("Part")
  209.             k.Parent = workspace
  210.             k.formFactor = "Plate"
  211.             k.Size = Vector3.new(1,0.4,1)
  212.             k.TopSurface = 0
  213.             k.BottomSurface = 0
  214.             k.Transparency = 0.4
  215.             k.Anchored = true
  216.             k.CanCollide = false
  217.             k.CFrame = handlea.CFrame * CFrame.new(kokoe,kokoq,koko)
  218.             k.CFrame = k.CFrame * CFrame.Angles(math.random(),math.random(),math.random())
  219.             k.BrickColor = BrickColor.new(colors[math.random(1,numba)])
  220.             local po = Instance.new("SpecialMesh")
  221.             po.Parent = k
  222.             po.MeshType = "Brick"
  223.             po.Scale = Vector3.new(0.3,0.3,0.3)
  224.             coroutine.resume(coroutine.create(function()
  225.                 for i=1, 12 do
  226.                     wait()
  227.                     k.Transparency = k.Transparency + 0.05
  228.                 end
  229.                 k:remove()
  230.             end))
  231.         end
  232.     end))
  233.     rw.Part0 = rw.Parent
  234.     rw.Part1 = rarm
  235.     for i=1, 6 do
  236.         wait(0.03)
  237.         rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(-0.4,0,0.1)
  238.     end
  239.     for i=1, 6 do
  240.         wait(0.03)
  241.         rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(-0.12,0.1,-0.24)
  242.     end
  243.     armweld.Part1 = mainhandle
  244.     wephold.Part0 = nil
  245.     wephold.Part1 = nil
  246.     wait(0.05)
  247.     for i=1, 7 do
  248.         wait(0.03)
  249.         rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(0.3,0.25,0.1)
  250.     end
  251.     lw.Part0 = lw.Parent
  252.     lw.Part1 = larm
  253.     rw.C0 = CFrame.new(0,0,0)
  254.     mouse.KeyDown:connect(function(key)
  255.         if swinging then return end
  256.         key = key:lower()
  257.         if (key == "q") then
  258.             swinging = true
  259.             for i=1, 6 do
  260.                 rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(0.3,-0.1,-0.2)
  261.                 lw.C0 = lw.C0 * CFrame.fromEulerAnglesXYZ(0.08,0,0.12)
  262.                 wait(0.04)
  263.             end
  264.             wait(0.05)
  265.             hitting = true
  266.             for i=1, 6 do
  267.                 rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(-0.3,-0.02,0.4)
  268.                 lw.C0 = lw.C0 * CFrame.fromEulerAnglesXYZ(-0.15,0,-0.25)
  269.                 wait(0.03)
  270.             end
  271.             wait(0.1)
  272.             hitting = false
  273.             for i=1, 4 do
  274.                 rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(0.3,0.02,0.1)
  275.                 lw.C0 = lw.C0 * CFrame.fromEulerAnglesXYZ(0.15,0.1,0.25)
  276.                 wait(0.03)
  277.             end
  278.             rw.C0 = CFrame.new(0,0,0)
  279.             lw.C0 = CFrame.new(0,0,0)
  280.             swinging = false
  281.         elseif (key == "e") then
  282.             swinging = true
  283.             for i=1, 6 do
  284.                 rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(0.15,-0.3,-0.05)
  285.                 lw.C0 = lw.C0 * CFrame.fromEulerAnglesXYZ(0.3,-0.2,0)
  286.                 wait(0.1)
  287.             end
  288.             rw.C0 = CFrame.new(0,0,0)
  289.             lw.C0 = CFrame.new(0,0,0)
  290.             swinging = false
  291.         end
  292.     end)
  293. end
  294.  
  295. function desel()
  296.     sele = false
  297.     lw.Part0 = nil
  298.     lw.Part1 = nil
  299.     for i=1, 7 do
  300.         wait(0.03)
  301.         rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(-0.2,-0.1,0.05)
  302.     end
  303.     for i=1, 5 do
  304.         wait(0.03)
  305.         rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(-0.3,-0.15,-0.2)
  306.     end
  307.     wait(0.03)
  308.     rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(-0.2,0.2,0.2)
  309.     wait(0.02)
  310.     wephold.Part0 = wephold.Parent
  311.     wephold.Part1 = mainhandle
  312.     armweld.Part1 = nil
  313.     wait(0.07)
  314.     for i=1, 4 do
  315.         wait(0.03)
  316.         rw.C0 = rw.C0 * CFrame.fromEulerAnglesXYZ(0.3,0.25,0.1)
  317.     end
  318.     rw.C0 = CFrame.new(0,0,0)
  319.     rw.Part0 = nil
  320.     rw.Part1 = nil
  321. end
  322.  
  323. sp.Selected:connect(selected)
  324. sp.Deselected:connect(desel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement