Advertisement
IHATEMICROWAVEOVEN

aooe code also by squeeze

Jul 27th, 2023 (edited)
1,268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. -- "Visual trait" variables
  2. local aoeColor = BrickColor.new("Dirt brown")
  3. local aoeStartTrans = 0.5
  4. local aoeStartSize = Vector3.new(45, 1.5, 45)
  5. local aoeEndSize = Vector3.new(55, 3, 55)
  6.  
  7. -- "Mechanical trait" variables
  8. local DMG = 100
  9. local RADIUS = 40
  10.  
  11. local TweenService = game:GetService("TweenService")
  12. local RunService = game:GetService("RunService")
  13. local DamageService = require(game.ServerScriptService:WaitForChild("Libraries"):WaitForChild("DamageService"))
  14.  
  15. -- Attack script
  16. function Use(...)
  17.     local args = {...}
  18.     local root = args[1].Character.Torso
  19.     local humanoid = args[1].Character.Humanoid
  20.     local plrAtt = Instance.new("Attachment", root)
  21.    
  22.  
  23.     local aligner = Instance.new("Part")
  24.     local alignerAtt = Instance.new("Attachment", aligner)
  25.     aligner.CanCollide, aligner.Anchored, aligner.Transparency, aligner.CFrame =
  26.         false, true, 1, root.CFrame*CFrame.Angles(0, math.rad(90), 0)
  27.     aligner.Parent = workspace
  28.     local plrAlignO = Instance.new("AlignOrientation")
  29.     plrAlignO.Attachment0, plrAlignO.Attachment1, plrAlignO.RigidityEnabled =
  30.         plrAtt, alignerAtt, true
  31.     plrAlignO.Parent = root
  32.     local plrBodyV = Instance.new("BodyVelocity")
  33.     plrBodyV.MaxForce, plrBodyV.Velocity =
  34.         Vector3.new(math.huge, math.huge, math.huge), Vector3.zero
  35.     plrBodyV.Parent = root
  36.    
  37.    
  38.     task.wait(0.12)
  39.     local aoe = Instance.new("Part")
  40.     aoe.Material, aoe.Anchored, aoe.CanCollide, aoe.CFrame, aoe.BrickColor, aoe.Transparency, aoe.Size =
  41.         "SmoothPlastic", true, false, root.CFrame, aoeColor, aoeStartTrans, aoeStartSize
  42.     local OnHeartbeat OnHeartbeat = RunService.Heartbeat:Connect(function() aoe.CFrame = root.CFrame end)
  43.     -- AlignOrientation and AlignPosition proved incredibly strange-looking for AoE movement, so I opted for this approach.
  44.     aoe.Parent = workspace
  45.     DamageService:RegisterRangeDamage(args[1], RADIUS, DMG)
  46.     aligner.CFrame *= CFrame.Angles(0, math.rad(-90), 0)
  47.     plrBodyV.Velocity = Vector3.new(0, -3, 0)
  48.    
  49.    
  50.     local SizeMod = TweenService:Create(aoe, TweenInfo.new(3.7, Enum.EasingStyle.Quint), {Size = aoeEndSize, Transparency = 1})
  51.     SizeMod.Completed:Connect(function() aoe:Destroy() plrAtt:Destroy() OnHeartbeat:Disconnect() end)
  52.     SizeMod:Play()
  53.     task.wait(0.05)
  54.     plrAlignO:Destroy() aligner:Destroy() plrBodyV:Destroy()
  55. end
  56.  
  57. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement