Advertisement
IHATEMICROWAVEOVEN

abandoned echo

Dec 19th, 2023
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. -- "Visual trait" variables
  2. local aoeColor = BrickColor.new("Royal purple")
  3. local aoeStartTrans = 0.5
  4. local aoeStartSize = Vector3.new(45, 45, 45)
  5. local aoeEndSize = Vector3.new(55, 55, 55)
  6. local projColor = BrickColor.new("Royal purple")
  7. local projTrans = 0.5
  8. local projSize = Vector3.new(2, 2, 2)
  9.  
  10. -- "Mechanical trait" variables
  11. local aoeDMG = 90
  12. local aoeRADIUS = 30 -- 40 is the same as EQ and Self-Destruct, 30 is the same as MagmaStorm and Blizzard
  13. local projDMG = 15
  14.  
  15. local TweenService = game:GetService("TweenService")
  16. local RunService = game:GetService("RunService")
  17. local Debris = game:GetService("Debris")
  18. local DamageService = require(game.ServerScriptService:WaitForChild("Libraries"):WaitForChild("DamageService"))
  19.  
  20. -- Attack script
  21. function Use(...)
  22. local args = {...}
  23. local root = args[1].Character.Torso
  24. local humanoid = args[1].Character.Humanoid
  25. local plrAtt = Instance.new("Attachment", root)
  26.  
  27. -- Projectiles
  28. local saveCF = root.CFrame
  29. for i = 1, 5 do
  30. local projAngle = math.rad(30*i-90)
  31. local proj = Instance.new("Part")
  32. proj.CanCollide, proj.Material, proj.Transparency, proj.BrickColor, proj.Size, proj.CFrame =
  33. false, "Neon", projTrans, projColor, projSize, saveCF*CFrame.Angles(0, projAngle, 0)*CFrame.new(0, 0, -5)
  34. proj.Parent = workspace
  35. local projAtt = Instance.new("Attachment", proj)
  36. local projLineV = Instance.new("LinearVelocity")
  37. projLineV.Attachment0, projLineV.MaxForce, projLineV.VectorVelocity =
  38. projAtt, math.huge, saveCF.Rotation*CFrame.Angles(0, projAngle, 0).LookVector*80
  39. projLineV.Parent = proj
  40. Debris:AddItem(proj, 7)
  41. DamageService:RegisterWeaponPart(args[1], {proj}, projDMG)
  42. proj.Parent = workspace
  43. end
  44.  
  45. -- Player twist
  46. local aligner = Instance.new("Part")
  47. local alignerAtt = Instance.new("Attachment", aligner)
  48. aligner.CanCollide, aligner.Anchored, aligner.Transparency, aligner.CFrame =
  49. false, true, 1, root.CFrame*CFrame.Angles(0, math.rad(90), 0)
  50. aligner.Parent = workspace
  51. local plrAlignO = Instance.new("AlignOrientation")
  52. plrAlignO.Attachment0, plrAlignO.Attachment1, plrAlignO.RigidityEnabled =
  53. plrAtt, alignerAtt, true
  54. plrAlignO.Parent = root
  55. local plrBodyV = Instance.new("BodyVelocity")
  56. plrBodyV.MaxForce, plrBodyV.Velocity =
  57. Vector3.new(math.huge, math.huge, math.huge), Vector3.zero
  58. plrBodyV.Parent = root
  59.  
  60. -- AoE cast
  61. task.wait(0.12)
  62. local aoe = Instance.new("Part")
  63. aoe.Material, aoe.Anchored, aoe.CanCollide, aoe.CFrame, aoe.BrickColor, aoe.Transparency, aoe.Size =
  64. "Neon", true, false, root.CFrame, aoeColor, aoeStartTrans, aoeStartSize
  65. local OnHeartbeat OnHeartbeat = RunService.Heartbeat:Connect(function() aoe.CFrame = root.CFrame end)
  66. -- AlignOrientation and AlignPosition proved incredibly strange-looking for AoE movement, so I opted for this approach.
  67. aoe.Parent = workspace
  68. DamageService:RegisterRangeDamage(args[1], aoeRADIUS, aoeDMG)
  69. aligner.CFrame *= CFrame.Angles(0, math.rad(-90), 0)
  70. plrBodyV.Velocity = Vector3.new(0, -3, 0)
  71.  
  72. -- AoE dissipation
  73. local SizeMod = TweenService:Create(aoe, TweenInfo.new(3.7, Enum.EasingStyle.Quint), {Size = aoeEndSize, Transparency = 1})
  74. SizeMod.Completed:Connect(function() aoe:Destroy() plrAtt:Destroy() OnHeartbeat:Disconnect() end)
  75. SizeMod:Play()
  76. task.wait(0.05)
  77. plrAlignO:Destroy() aligner:Destroy() plrBodyV:Destroy()
  78. end
  79.  
  80. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement