Advertisement
VanishingDragon

Untitled

Mar 11th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. game:GetObjects("rbxassetid://497382476")[1].Parent=game.Players.LocalPlayer.Backpack
  2. BoomSound = Instance.new("Sound" ,game.Players.LocalPlayer.Backpack["Sword Execution"])
  3. BoomSound.SoundId = "rbxasset://sounds/Rocket shot.wav"
  4. BoomSound.Name = "Boom"
  5. BeepSound = Instance.new("Sound" ,game.Players.LocalPlayer.Backpack["Sword Execution"])
  6. BeepSound.SoundId = "http://www.roblox.com/asset/?id=94137771"
  7. BeepSound.Name = "Beep"
  8. SwordAnim = Instance.new("Animation" ,game.Players.LocalPlayer.Backpack["Sword Execution"])
  9. SwordAnim.AnimationId = "http://www.roblox.com/Asset?ID=89289879"
  10. SwordAnim.Name = "AxeSwing"
  11. local Tool = game.Players.LocalPlayer.Backpack["Sword Execution"];
  12. enabled = true
  13. function onButton1Down(mouse)
  14. if not enabled then
  15. return
  16. end
  17. enabled = false
  18. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  19. wait(1)
  20. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  21. enabled = true
  22. end
  23. function onEquippedLocal(mouse)
  24. if mouse == nil then
  25. print("Mouse not found")
  26. return
  27. end
  28. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  29. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  30. end
  31. Tool.Equipped:connect(onEquippedLocal)
  32. --[[Super Util]]--
  33. function WaitForChild(parent,child)
  34. while not parent:FindFirstChild(child) do wait(1/30) end
  35. return parent[child]
  36. end
  37. function MakeValue(class,name,value,parent)
  38. local temp = Instance.new(class)
  39. temp.Name = name
  40. temp.Value = value
  41. temp.Parent = parent
  42. return temp
  43. end
  44. function TweenProperty(obj, propName, inita, enda, length)
  45. local startTime = tick()
  46. while startTime - tick()<length do
  47. obj[propName] = (startTime - tick())/length
  48. wait(1/30)
  49. end
  50. obj[propName] = enda
  51. end
  52. local function weldBetween(a, b)
  53. local weld = Instance.new("ManualWeld")
  54. weld.Part0 = a
  55. weld.Part1 = b
  56. weld.C0 = CFrame.new()
  57. weld.C1 = b.CFrame:inverse() * a.CFrame
  58. weld.Parent = a
  59. return weld;
  60. end
  61. --[[Constants]]--
  62. local COOLDOWN=.5
  63. local SWING_COOLDOWN = 2.5
  64. local DAMAGE = 99
  65. --[[Workspace Variables]]--
  66. local Tool = game.Players.LocalPlayer.Backpack["Sword Execution"]
  67. local Handle = WaitForChild(game.Players.LocalPlayer.Backpack["Sword Execution"],'Handle')
  68. local SwingAni = WaitForChild(Tool,'AxeSwing')
  69. local SwingAniTrack = nil
  70. local SwingSound = WaitForChild(Handle,'Swing')
  71. local ExplodeSound = WaitForChild(Tool,'Boom')
  72. local BeepSound = WaitForChild(Tool,'Beep')
  73. local lastSwing = 0
  74. --[[Script Variables]]--
  75. local lastHit = tick()
  76. local lastDamage = tick()
  77. --[[Script Functions]]--
  78. function flashColor(obj,color)
  79. if obj:IsA('Part') then
  80. obj.BrickColor = BrickColor.new(color)
  81. elseif obj:IsA('FileMesh') then
  82. obj.VertexColor=Vector3.new(color.r*3,color.g*3,color.b*3)
  83. end
  84. for _,i in pairs(obj:GetChildren()) do
  85. flashColor(i,color)
  86. end
  87. end
  88. Handle.Touched:connect(function(part)
  89. if part.Parent == Tool.Parent then return end
  90. if not part.Parent:FindFirstChild('Humanoid') then return end
  91. if part.Parent:FindFirstChild('ForceField') then return end
  92. if tick()-lastDamage < COOLDOWN then return end
  93. if tick()-lastSwing>SWING_COOLDOWN then return end
  94. lastDamage=tick()
  95. part.Parent.Humanoid:TakeDamage(DAMAGE)
  96. if not part.Parent:FindFirstChild('Head') then return end
  97. if part.Parent.Head.Transparency==1 then return end
  98. SwingSound:Play()
  99. lastHit=tick()
  100. local nhead=part.Parent.Head:Clone()
  101. for _,i in pairs(part.Parent:GetChildren()) do
  102. if i:IsA('Hat') and i:FindFirstChild('Handle') then
  103. local that =i.Handle
  104. that.Parent = nhead
  105. weldBetween(nhead,that)
  106. i:Destroy()
  107. end
  108. end
  109.  
  110. part.Parent.Head.Transparency=1
  111. part.Parent.Head:ClearAllChildren()
  112. nhead.Velocity = Vector3.new(math.random()*25-15,25,math.random()*25-15)
  113. nhead.Parent = game.Workspace
  114. local nbeep = BeepSound:Clone()
  115. nbeep.Parent = nhead
  116. salil = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  117. salil.Name = "salil"
  118. salil.Volume = 100
  119. salil.SoundId = "rbxassetid://403330704"
  120. salil:Play()
  121. for i=1,10,1 do
  122. flashColor(nhead,Color3.new(1,0,0))
  123. nbeep:Play()
  124. wait(1/i)
  125. flashColor(nhead,Color3.new(1,1,1))
  126. wait(1/i)
  127. end
  128. local nsound = ExplodeSound:Clone()
  129. nsound.Parent = nhead
  130. nsound:Play()
  131. salil:Pause()
  132. salil:Destroy()
  133. local explode = Instance.new('Explosion')
  134. explode.Position = nhead.CFrame.p
  135. explode.Parent = nhead
  136. game.Debris:AddItem(nhead,1)
  137. end)
  138. --[[Running Logic]]--
  139. Tool.Activated:connect(function()
  140. if tick()-lastSwing<SWING_COOLDOWN then return end
  141. lastSwing = tick()
  142. if not SwingAniTrack then
  143. local player = Tool.Parent
  144. local humanoid = player:FindFirstChild('Humanoid')
  145. SwingAniTrack = humanoid:LoadAnimation(SwingAni)
  146. end
  147. SwingAniTrack:Play()
  148. end)
  149. Tool.Unequipped:connect(function()
  150. if SwingAniTrack then
  151. SwingAniTrack:Stop()
  152. SwingAniTrack:Destroy()
  153. end
  154. end)
  155.  
  156. Script chunked by https://mdbooktech.com/codechunk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement