Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- "Visual trait" variables
- local aoeColor = BrickColor.new("Dirt brown")
- local aoeStartTrans = 0.5
- local aoeStartSize = Vector3.new(45, 1.5, 45)
- local aoeEndSize = Vector3.new(55, 3, 55)
- -- "Mechanical trait" variables
- local DMG = 100
- local RADIUS = 40
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- local DamageService = require(game.ServerScriptService:WaitForChild("Libraries"):WaitForChild("DamageService"))
- -- Attack script
- function Use(...)
- local args = {...}
- local root = args[1].Character.Torso
- local humanoid = args[1].Character.Humanoid
- local plrAtt = Instance.new("Attachment", root)
- local aligner = Instance.new("Part")
- local alignerAtt = Instance.new("Attachment", aligner)
- aligner.CanCollide, aligner.Anchored, aligner.Transparency, aligner.CFrame =
- false, true, 1, root.CFrame*CFrame.Angles(0, math.rad(90), 0)
- aligner.Parent = workspace
- local plrAlignO = Instance.new("AlignOrientation")
- plrAlignO.Attachment0, plrAlignO.Attachment1, plrAlignO.RigidityEnabled =
- plrAtt, alignerAtt, true
- plrAlignO.Parent = root
- local plrBodyV = Instance.new("BodyVelocity")
- plrBodyV.MaxForce, plrBodyV.Velocity =
- Vector3.new(math.huge, math.huge, math.huge), Vector3.zero
- plrBodyV.Parent = root
- task.wait(0.12)
- local aoe = Instance.new("Part")
- aoe.Material, aoe.Anchored, aoe.CanCollide, aoe.CFrame, aoe.BrickColor, aoe.Transparency, aoe.Size =
- "SmoothPlastic", true, false, root.CFrame, aoeColor, aoeStartTrans, aoeStartSize
- local OnHeartbeat OnHeartbeat = RunService.Heartbeat:Connect(function() aoe.CFrame = root.CFrame end)
- -- AlignOrientation and AlignPosition proved incredibly strange-looking for AoE movement, so I opted for this approach.
- aoe.Parent = workspace
- DamageService:RegisterRangeDamage(args[1], RADIUS, DMG)
- aligner.CFrame *= CFrame.Angles(0, math.rad(-90), 0)
- plrBodyV.Velocity = Vector3.new(0, -3, 0)
- local SizeMod = TweenService:Create(aoe, TweenInfo.new(3.7, Enum.EasingStyle.Quint), {Size = aoeEndSize, Transparency = 1})
- SizeMod.Completed:Connect(function() aoe:Destroy() plrAtt:Destroy() OnHeartbeat:Disconnect() end)
- SizeMod:Play()
- task.wait(0.05)
- plrAlignO:Destroy() aligner:Destroy() plrBodyV:Destroy()
- end
- return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement