Advertisement
IHATEMICROWAVEOVEN

DragonHammer

Jan 30th, 2023 (edited)
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. -- BELOW IS THE CLIENT SCRIPT. [menacing]
  2. -- BELOW IS THE CLIENT SCRIPT. [menacing]
  3. -- BELOW IS THE CLIENT SCRIPT. [menacing]
  4. -- BELOW IS THE CLIENT SCRIPT. [menacing]
  5. -- BELOW IS THE CLIENT SCRIPT. [menacing]
  6.  
  7. -- SETTINGS
  8. local reload = 9
  9. local name = "DragonHammer"
  10. -- SCRIPT
  11. local debounce = true
  12. function Use(plr, device, CS, CWS)
  13. if debounce then
  14. debounce = false
  15. CWS("RunWeapon", name)
  16. task.wait(0.5)
  17. debounce = true
  18. end
  19. end
  20.  
  21. return {Use, reload}
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. -- BELOW IS THE SERVER SCRIPT. [menacing]
  33. -- BELOW IS THE SERVER SCRIPT. [menacing]
  34. -- BELOW IS THE SERVER SCRIPT. [menacing]
  35. -- BELOW IS THE SERVER SCRIPT. [menacing]
  36. -- BELOW IS THE SERVER SCRIPT. [menacing]
  37.  
  38. -- EASE OF ACCESS SETTINGS
  39. local inColor = Color3.new(0.2, 0.2, 0.6)
  40. local outColor = Color3.new(0.7, 0, 0.7)
  41. local inTrans = 0
  42. local outTrans = 0.5
  43. local inSize = Vector3.new(7, 7, 7)
  44. local outSize = Vector3.new(10, 10, 10)
  45. local inMaterial = "SmoothPlastic"
  46. local outMaterial = "SmoothPlastic"
  47.  
  48. local secColor = Color3.new(0.1, 0.17, 0.21)
  49. local secMaterial = "Glass"
  50. local secSize = Vector3.new(9, 9, 9)
  51.  
  52. local baseDamage = 90
  53. local lifetime = 2
  54. -- Lifetime of part 2 is 50% of this
  55.  
  56. local foo = task
  57.  
  58. --[[
  59.  
  60. Below is the attack function.
  61.  
  62. DESC: Melee with two parts. First part initiates a stun on hit players (they drop to the ground instead of being
  63. anchored, however). Second part provides greatly increased speed for a brief period and deals damage.
  64.  
  65. --]]
  66. local function Use(...)
  67. local args = {...}
  68. local char = args[1].Character
  69. local torso = char.Torso
  70. local damage = math.random(1, 10) == 1 and baseDamage*2 or baseDamage
  71.  
  72. -- Part creation
  73. local inner = Instance.new("Part")
  74. inner.Color, inner.Size, inner.Transparency, inner.Material, inner.Massless, inner.CanCollide, inner.CFrame =
  75. inColor, inSize, inTrans, inMaterial, true, false, torso.CFrame
  76. inner.Parent = workspace
  77. local outer = Instance.new("Part")
  78. outer.Color, outer.Size, outer.Transparency, outer.Material, outer.Massless, outer.CanCollide, outer.CFrame =
  79. outColor, outSize, outTrans, outMaterial, true, false, torso.CFrame
  80. outer.Parent = workspace
  81.  
  82. local oplib = require(game.ServerScriptService.Libraries.Optimalization)
  83. oplib(outer)
  84.  
  85. local weld = Instance.new("Weld")
  86. weld.Part0, weld.Part1 =
  87. torso, inner
  88. weld.Parent = inner
  89. weld = Instance.new("Weld")
  90. weld.Part0, weld.Part1 =
  91. torso, outer
  92. weld.Parent = outer
  93.  
  94.  
  95.  
  96. -- Speed and attack part 1
  97. local hum = char.Humanoid
  98. local Stats = require(game:GetService("ServerScriptService").Stats)
  99. local myLevel = Stats.GetStat(args[1], char.BaseStat.Value)
  100. local mySpeed = char.BaseSpeed
  101. coroutine.wrap(function()
  102. for i = 0, lifetime * 10 do
  103. hum.WalkSpeed = mySpeed.Value*0.5 * (myLevel*0.01 + 1)
  104. task.wait(0.1)
  105. end
  106. hum.WalkSpeed = mySpeed.Value*0.25 * (myLevel*0.01 + 1)
  107. end)()
  108. -- PART 1 of attack ("stun")
  109. local last = nil -- stores last hit player by first part
  110. local DamageMod = require(game:GetService("ServerScriptService").Libraries.DamageService)
  111. DamageMod:RegisterWeaponPart(args[1], {inner, outer}, 0, function(hit)
  112. if hit:IsA("Player") then
  113. last = hit
  114. local hitChar = hit.Character
  115. Stats.SetStat(hit, "SLP", 1)
  116. local saveBS = hitChar.BaseSpeed.Value
  117. local saveJP = hitChar.Humanoid.JumpPower
  118. hitChar.BaseSpeed.Value = 0
  119. hitChar.Humanoid.JumpPower = 0
  120. hitChar.Humanoid.WalkSpeed = 0
  121. foo.wait(4)
  122. hitChar.BaseSpeed.Value += saveBS
  123. hitChar.Humanoid.JumpPower += saveJP
  124. hitChar.Humanoid.WalkSpeed = saveBS*0.25 * (Stats.GetStat(hit, hitChar.BaseStat.Value)*0.01 + 1)
  125. Stats.SetStat(hit, "SLP", 0)
  126. else
  127. DamageMod:RegisterDamage(args[1], hit, damage)
  128. end
  129. end)
  130. foo.wait(lifetime)
  131. inner:Destroy()
  132. outer:Destroy()
  133.  
  134. -- If you hit something, then it's time for part 2 (damage)
  135. if last then
  136. foo.wait(0.7)
  137. mySpeed.Value *= 3
  138. hum.WalkSpeed = mySpeed.Value*0.25 * (myLevel*0.01 + 1)
  139. local sec = Instance.new("Part")
  140. sec.Color, sec.Size, sec.Transparency, sec.Material, sec.Massless, sec.CanCollide, sec.CFrame =
  141. secColor, secSize, 0, secMaterial, true, false, torso.CFrame
  142. sec.Parent = workspace
  143. weld = Instance.new("Weld")
  144. weld.Part0, weld.Part1 =
  145. torso, sec
  146. weld.Parent = sec
  147.  
  148. local Debris = game:GetService("Debris")
  149. DamageMod:RegisterWeaponPart(args[1], {sec}, damage, function(hit)
  150. local explosion = Instance.new("Explosion", args[1].Character)
  151. local hitTorso = hit:FindFirstChild("Character") and hit.Character.Torso or hit.Torso
  152. explosion.DestroyJointRadiusPercent, explosion.BlastPressure, explosion.Position =
  153. 0, 0, hitTorso.Position
  154. Debris:AddItem(explosion, 1)
  155. end)
  156. foo.wait(lifetime*.5)
  157. mySpeed.Value /= 3
  158. hum.WalkSpeed = mySpeed.Value*0.25 * (myLevel*0.01 + 1)
  159. sec:Destroy()
  160. end
  161. end
  162.  
  163. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement