Advertisement
IHATEMICROWAVEOVEN

short aoe

Apr 11th, 2023
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. -- EASE OF ACCESS SETTINGS
  2. local aoeColor = Color3.new(1, 0.7, 0.7)
  3. local aoeTrans = 0.5
  4. local aoeVisSize = Vector3.new(45, 2, 45) -- visually starts at this
  5. local aoeFinSize = Vector3.new(60, 7, 60) -- and expands to this
  6. local aoeMaterial = "Neon"
  7.  
  8. local baseDamage = 80
  9. local radius = 20
  10.  
  11. local TweenService = game:GetService("TweenService")
  12. local foo = task
  13.  
  14. --[[
  15.  
  16. Below is the attack function.
  17.  
  18. DESC: Basic AoE.
  19.  
  20. --]]
  21. local function Use(...)
  22. local args = {...}
  23. local root = args[1].Character.Torso
  24. local damage = math.random(1, 10) == 1 and baseDamage*2 or baseDamage
  25.  
  26.  
  27. -- Create AoE "oomph" (the midair pause)
  28. local att0 = Instance.new("Attachment", root)
  29. local bv = Instance.new("LinearVelocity")
  30. bv.Attachment0, bv.MaxForce, bv.VectorVelocity =
  31. att0, math.huge, Vector3.new(0, -3, 0)
  32. bv.Parent = root
  33.  
  34. local bg = Instance.new("AlignOrientation", root)
  35. local sub = Instance.new("Part")
  36. local att1 = Instance.new("Attachment", sub)
  37. sub.CanCollide, sub.Anchored, sub.Transparency, sub.CFrame =
  38. false, true, 1, root.CFrame * CFrame.Angles(0, math.rad(107), 0)
  39. sub.Parent = workspace
  40. bg.Attachment0, bg.Attachment1, bg.Mode, bg.RigidityEnabled =
  41. att0, att1, Enum.OrientationAlignmentMode.TwoAttachment, true
  42.  
  43.  
  44. -- Create visual AoE
  45. local p = Instance.new("Part")
  46. p.Color, p.Material, p.Transparency, p.Size, p.Anchored, p.CanCollide, p.CFrame =
  47. aoeColor, aoeMaterial, aoeTrans, aoeVisSize, true, false, root.CFrame*CFrame.Angles(0, math.rad(math.random(10, 45)), 0)
  48. p.Parent = workspace
  49. TweenService:Create(p, TweenInfo.new(3, Enum.EasingStyle.Linear), {Size = aoeFinSize, Transparency = 1}):Play()
  50. coroutine.wrap(function()
  51. foo.wait(0.1)
  52. for i = 1,200 do
  53. p.CFrame = root.CFrame
  54. foo.wait(1/60)
  55. end
  56. p:Destroy()
  57. end)()
  58.  
  59.  
  60. -- Damage
  61. local DamageMod = require(game.ServerScriptService.Libraries.DamageService)
  62. DamageMod:RegisterRangeDamage(args[1], radius, damage)
  63. foo.wait(0.1)
  64. sub.CFrame *= CFrame.Angles(0, math.rad(253), 0)
  65. foo.wait(0.1)
  66. bv:Destroy()
  67. bg:Destroy()
  68. sub:Destroy()
  69. att0:Destroy()
  70. end
  71.  
  72. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement