Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- "Visual trait" variables
- local aoeColor = BrickColor.new("Royal purple")
- local aoeStartTrans = 0.5
- local aoeStartSize = Vector3.new(45, 45, 45)
- local aoeEndSize = Vector3.new(55, 55, 55)
- local projColor = BrickColor.new("Royal purple")
- local projTrans = 0.5
- local projSize = Vector3.new(2, 2, 2)
- -- "Mechanical trait" variables
- local aoeDMG = 90
- local aoeRADIUS = 30 -- 40 is the same as EQ and Self-Destruct, 30 is the same as MagmaStorm and Blizzard
- local projDMG = 15
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- local Debris = game:GetService("Debris")
- 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)
- -- Projectiles
- local saveCF = root.CFrame
- for i = 1, 5 do
- local projAngle = math.rad(30*i-90)
- local proj = Instance.new("Part")
- proj.CanCollide, proj.Material, proj.Transparency, proj.BrickColor, proj.Size, proj.CFrame =
- false, "Neon", projTrans, projColor, projSize, saveCF*CFrame.Angles(0, projAngle, 0)*CFrame.new(0, 0, -5)
- proj.Parent = workspace
- local projAtt = Instance.new("Attachment", proj)
- local projLineV = Instance.new("LinearVelocity")
- projLineV.Attachment0, projLineV.MaxForce, projLineV.VectorVelocity =
- projAtt, math.huge, saveCF.Rotation*CFrame.Angles(0, projAngle, 0).LookVector*80
- projLineV.Parent = proj
- Debris:AddItem(proj, 7)
- DamageService:RegisterWeaponPart(args[1], {proj}, projDMG)
- proj.Parent = workspace
- end
- -- Player twist
- 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
- -- AoE cast
- task.wait(0.12)
- local aoe = Instance.new("Part")
- aoe.Material, aoe.Anchored, aoe.CanCollide, aoe.CFrame, aoe.BrickColor, aoe.Transparency, aoe.Size =
- "Neon", 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], aoeRADIUS, aoeDMG)
- aligner.CFrame *= CFrame.Angles(0, math.rad(-90), 0)
- plrBodyV.Velocity = Vector3.new(0, -3, 0)
- -- AoE dissipation
- 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