Advertisement
IHATEMICROWAVEOVEN

multihit

Sep 1st, 2023
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. -- EASE OF ACCESS SETTINGS
  2. local inColor = Color3.new(0.45, 0.65, 0.9)
  3. local outColor = Color3.new(0.75, 1, 1)
  4. local inTrans = 0.3
  5. local outTrans = 0.5
  6. local inSize = Vector3.new(4, 4, 4)
  7. local outSize = Vector3.new(7, 7, 7)
  8. local inMaterial = "Ice"
  9. local outMaterial = "Ice"
  10.  
  11. local baseDamage = 20
  12. local hits = 3
  13. local lifetime = 2
  14. local postFirstLifetime = 1 -- lifetim of hits after first
  15.  
  16. --[[
  17.  
  18. Below is the attack function.
  19.  
  20. DESC: Strikes X amount of times. Subsequent hits give SSneak speed instead of normal.
  21.  
  22. --]]
  23.  
  24. local function Use(...)
  25. local args = {...}
  26. local char = args[1].Character
  27. local torso = char.Torso
  28. local hum = char.Humanoid
  29.  
  30. local Stats = require(game:GetService("ServerScriptService").Stats)
  31. local DamageMod = require(game:GetService("ServerScriptService").Libraries.DamageService)
  32.  
  33. local myLevel = Stats.GetStat(args[1], char.BaseStat.Value)
  34. local mySpeed = char.BaseSpeed
  35.  
  36.  
  37.  
  38. for i = 1, hits do
  39. local damage = math.random(1, 20) == 1 and baseDamage*2 or baseDamage -- reduced crit (the move is already kinda toxic)
  40. -- damage*=i
  41. -- In order to achieve the damage increase from TripleAxel, uncomment the above line.
  42.  
  43. -- Part creation and some variables
  44. local inner = Instance.new("Part")
  45. inner.Color, inner.Size, inner.Transparency, inner.Material, inner.Massless, inner.CanCollide, inner.CFrame =
  46. inColor, inSize, inTrans, inMaterial, true, false, torso.CFrame
  47. inner.Parent = workspace
  48. local outer = Instance.new("Part")
  49. outer.Color, outer.Size, outer.Transparency, outer.Material, outer.Massless, outer.CanCollide, outer.CFrame =
  50. outColor, outSize, outTrans, outMaterial, true, false, torso.CFrame
  51. outer.Parent = workspace
  52.  
  53. local oplib = require(game.ServerScriptService.Libraries.Optimalization)
  54. oplib(outer)
  55.  
  56. local weld = Instance.new("Weld")
  57. weld.Part0, weld.Part1 =
  58. torso, inner
  59. weld.Parent = inner
  60. weld = Instance.new("Weld")
  61. weld.Part0, weld.Part1 =
  62. torso, outer
  63. weld.Parent = outer
  64.  
  65. local speedMulti = 0
  66. local finish = tick()
  67. if i == 1 then
  68. speedMulti = 2 * (myLevel*0.0025 + 0.25)
  69. finish += lifetime
  70. else
  71. speedMulti = 2 * (myLevel*0.0035 + 0.25)
  72. finish += postFirstLifetime
  73. end
  74.  
  75.  
  76. -- Speed and DMG
  77. local hit = false
  78. DamageMod:RegisterWeaponPart(args[1], {inner, outer}, damage, function() hit = true end)
  79. repeat
  80. hum.WalkSpeed = mySpeed.Value*speedMulti
  81. task.wait(0.05)
  82. until hit or tick()>=finish
  83. if hit then
  84. local finish2 = tick() + 0.3
  85. repeat
  86. hum.WalkSpeed = mySpeed.Value*speedMulti
  87. task.wait(0.05)
  88. until tick()>=finish or tick()>=finish2
  89. end
  90. inner:Destroy()
  91. outer:Destroy()
  92. task.wait(0.1)
  93. if i==hits or not hit then
  94. hum.WalkSpeed = mySpeed.Value*speedMulti/2
  95. break
  96. -- if not hit then hum.Sit = true end
  97. end
  98. end
  99. end
  100.  
  101. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement