ttvmetroidd

light beam attack

Jun 19th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. --Time changer for both Sword of Light & Darkness
  2. --Cool aesthetics included
  3.  
  4. function Create(ty)
  5. return function(data)
  6. local obj = Instance.new(ty)
  7. for k, v in pairs(data) do
  8. if type(k) == 'number' then
  9. v.Parent = obj
  10. else
  11. obj[k] = v
  12. end
  13. end
  14. return obj
  15. end
  16. end
  17.  
  18. local Services = {
  19. Players = (game:FindService("Players") or game:GetService("Players")),
  20. TweenService = (game:FindService("TweenService") or game:GetService("TweenService")),
  21. RunService = (game:FindService("RunService") or game:GetService("RunService")),
  22. Debris = (game:FindService("Debris") or game:GetService("Debris")),
  23. ReplicatedStorage = (game:FindService("ReplicatedStorage") or game:GetService("ReplicatedStorage")),
  24. Lighting = (game:FindService("Lighting") or game:GetService("Lighting")),
  25. ServerScriptService = (game:FindService("ServerScriptService") or game:GetService("ServerScriptService"))
  26. }
  27.  
  28. local Creator,Time,SpawnPosition,TimeSound,ChargeReady,Strike = script:WaitForChild("Creator").Value,script:WaitForChild("Time").Value,script:WaitForChild("SpawnPosition").Value,script:WaitForChild("TimeSound"),script:WaitForChild("ChargeReady"),script:WaitForChild("Strike")
  29. local Stars,StarSplash = script:WaitForChild("Stars"),script:WaitForChild("StarSplash")
  30.  
  31. local BeamWidth,BeamHeight = 7,1000
  32.  
  33. local LightBeam = Create("Part"){
  34. Material = Enum.Material.Neon,
  35. Name = "Light Beam",
  36. Size = Vector3.new(0,BeamWidth,BeamWidth),
  37. Shape = Enum.PartType.Cylinder,
  38. TopSurface = Enum.SurfaceType.Smooth,
  39. BottomSurface = Enum.SurfaceType.Smooth,
  40. Color = Color3.fromRGB(255,255,203),
  41. Anchored = true,
  42. CanCollide = false,
  43. Locked = true,
  44. }
  45.  
  46. local CelestialCircle = Create("Part"){
  47. Size = Vector3.new(1,.5,1),
  48. Anchored = true,
  49. CanCollide = false,
  50. Locked = true,
  51. Name = "CelestialCircle",
  52. Transparency = 1
  53. }
  54.  
  55. TimeSound.Parent = CelestialCircle
  56. ChargeReady.Parent = CelestialCircle
  57. Strike.Parent = CelestialCircle
  58. Stars.Parent = CelestialCircle
  59. StarSplash.Parent = CelestialCircle
  60.  
  61. local CelestialUI = script:WaitForChild("CelestialCircle")
  62. CelestialUI.Face = Enum.NormalId.Top
  63. CelestialUI.Parent = CelestialCircle
  64. CelestialUI.Enabled = true
  65.  
  66. local CelestialImage = CelestialUI:WaitForChild("Circle")
  67. CelestialImage.ImageColor3 = Color3.fromRGB(255,255,203)
  68.  
  69. CelestialUI2 = CelestialUI:Clone()
  70. CelestialUI2.Face = Enum.NormalId.Bottom
  71. CelestialUI2.Parent = CelestialCircle
  72.  
  73. local CelestialImage2 = CelestialUI:WaitForChild("Circle")
  74.  
  75. CelestialCircle.CFrame = CFrame.new(SpawnPosition)
  76. CelestialCircle.Parent = workspace
  77. Stars.Enabled = true
  78. ChargeReady:Play()
  79. TimeSound:Play()
  80.  
  81. coroutine.wrap(function()
  82. while CelestialCircle and CelestialCircle:IsDescendantOf(workspace) do
  83. CelestialCircle.CFrame = CelestialCircle.CFrame * CFrame.Angles(0,math.rad(-3),0)
  84. Services.RunService.Heartbeat:Wait()
  85. end
  86. script:Destroy()
  87. end)()
  88.  
  89. coroutine.wrap(function()
  90. --Cast large beam of light!
  91. LightBeam.Parent = workspace
  92. for i=0,60,1 do
  93. if LightBeam then
  94. LightBeam.Size = Vector3.new((i/60)*BeamHeight,BeamWidth,BeamWidth)
  95. LightBeam.CFrame = (CFrame.new(SpawnPosition) + Vector3.new(0,BeamHeight-(LightBeam.Size.X/2),0)) * CFrame.Angles(0,0,math.rad(90))
  96. end
  97. Services.RunService.Heartbeat:Wait()
  98. end
  99. StarSplash:Emit(StarSplash.Rate)
  100. Strike:Play()
  101. wait(1/2)
  102. for i=0,45,1 do
  103. if LightBeam then
  104. LightBeam.Size = Vector3.new(BeamHeight,BeamWidth,BeamWidth):Lerp(Vector3.new(BeamHeight,BeamWidth * 10,BeamWidth * 10),i/45)
  105. LightBeam.CFrame = (CFrame.new(SpawnPosition) + Vector3.new(0,BeamHeight-(LightBeam.Size.X/2),0)) * CFrame.Angles(0,0,math.rad(90))
  106. LightBeam.Transparency = (i/45)
  107. end
  108. Services.RunService.Heartbeat:Wait()
  109. end
  110. if LightBeam then LightBeam:Destroy() end
  111. end)()
  112.  
  113.  
  114. for i=0,50,1 do
  115. if CelestialCircle then
  116. CelestialCircle.Size = Vector3.new(i,.5,i)
  117. CelestialImage.ImageTransparency = (1-(i/50))
  118. CelestialImage2.ImageTransparency = (1-(i/50))
  119. end
  120. Services.RunService.Heartbeat:Wait()
  121. end
  122.  
  123. Services.Lighting.GeographicLatitude = 41.733
  124. local TimeTween = Services.TweenService:Create(Services.Lighting,TweenInfo.new(2,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0),{ClockTime = Time})
  125. TimeTween:Play();TimeTween.Completed:Wait()
  126.  
  127. Stars.Enabled = false
  128. for i=50,0,-1 do
  129. if CelestialCircle then
  130. CelestialCircle.Size = Vector3.new(i,.5,i)
  131. CelestialImage.ImageTransparency = (1-(i/50))
  132. CelestialImage2.ImageTransparency = (1-(i/50))
  133. end
  134. Services.RunService.Heartbeat:Wait()
  135. end
  136.  
  137. wait(Strike.TimeLength)
  138.  
  139. if CelestialCircle then
  140. CelestialCircle:Destroy()
  141. end
  142.  
  143. script:Destroy()
  144.  
Advertisement
Add Comment
Please, Sign In to add comment