Advertisement
Eproq012

Untitled

Sep 29th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.67 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local TweenService = game:GetService("TweenService")
  4. local Debris = game:GetService("Debris")
  5. local Camera = game.Workspace.CurrentCamera
  6. local player = Players.LocalPlayer
  7. local character = player.Character or player.CharacterAdded:Wait()
  8. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  9.  
  10. local hoverHeight = 10
  11. local hoverSpeed = 0.5
  12. local floating = true
  13.  
  14. local function floatPlayer()
  15. local originalPos = humanoidRootPart.Position
  16. local hoverDirection = 1
  17. local hoverOffset = 0
  18.  
  19. RunService.Heartbeat:Connect(function()
  20. if floating then
  21. hoverOffset = math.sin(tick() * hoverSpeed) * hoverDirection
  22. humanoidRootPart.CFrame = CFrame.new(originalPos + Vector3.new(0, hoverHeight + hoverOffset, 0))
  23. end
  24. end)
  25. end
  26.  
  27. humanoidRootPart.Anchored = true
  28. floatPlayer()
  29.  
  30. local ball = Instance.new("Part")
  31. ball.Shape = Enum.PartType.Ball
  32. ball.Size = Vector3.new(5, 5, 5)
  33. ball.Anchored = true
  34. ball.CanCollide = false
  35. ball.CastShadow = false
  36. ball.BrickColor = BrickColor.new("Light blue")
  37. ball.Transparency = 0.1
  38.  
  39. local light = Instance.new("PointLight")
  40. light.Parent = ball
  41. light.Brightness = 20
  42. light.Range = 80
  43. light.Color = Color3.fromRGB(0, 170, 255)
  44.  
  45. local particleEmitter = Instance.new("ParticleEmitter")
  46. particleEmitter.Texture = "rbxassetid://243660364"
  47. particleEmitter.Rate = 250
  48. particleEmitter.Speed = NumberRange.new(10, 20)
  49. particleEmitter.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 7), NumberSequenceKeypoint.new(1, 15)})
  50. particleEmitter.Lifetime = NumberRange.new(0.5, 1.2)
  51. particleEmitter.LightInfluence = 1
  52. particleEmitter.Rotation = NumberRange.new(0, 360)
  53. particleEmitter.Parent = ball
  54.  
  55. local sparksEmitter = Instance.new("ParticleEmitter")
  56. sparksEmitter.Texture = "rbxassetid://3611072548"
  57. sparksEmitter.Rate = 100
  58. sparksEmitter.Speed = NumberRange.new(5, 15)
  59. sparksEmitter.Size = NumberSequence.new(3)
  60. sparksEmitter.Lifetime = NumberRange.new(0.2, 0.5)
  61. sparksEmitter.Parent = ball
  62.  
  63. local function createLightning(position, targetPosition)
  64. local beam = Instance.new("Part")
  65. beam.Size = Vector3.new(0.2, 0.2, (position - targetPosition).Magnitude)
  66. beam.Anchored = true
  67. beam.CanCollide = false
  68. beam.Material = Enum.Material.Neon
  69. beam.Color = Color3.fromRGB(255, 255, 0)
  70. beam.CFrame = CFrame.new(position, targetPosition) * CFrame.new(0, 0, -beam.Size.Z / 2)
  71. beam.Parent = workspace
  72.  
  73. local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  74. local tween = TweenService:Create(beam, tweenInfo, {Transparency = 1})
  75. tween:Play()
  76.  
  77. Debris:AddItem(beam, 0.2)
  78. end
  79.  
  80. local rotationSpeed = 2
  81. RunService.Heartbeat:Connect(function()
  82. ball.CFrame = ball.CFrame * CFrame.Angles(0, math.rad(rotationSpeed), 0)
  83. end)
  84.  
  85. local head = character:WaitForChild("Head")
  86. ball.Position = head.Position + Vector3.new(0, 10 + ball.Size.Y / 2, 0)
  87. ball.Parent = workspace
  88.  
  89. local growTime = 0.05
  90. local growAmount = 0.8
  91. local maxSize = Vector3.new(60, 60, 60)
  92. local running = true
  93.  
  94. local function screenShake(duration, intensity)
  95. local elapsed = 0
  96. local basePosition = Camera.CFrame.Position
  97.  
  98. local shakeConnection
  99. shakeConnection = RunService.RenderStepped:Connect(function(deltaTime)
  100. if elapsed < duration then
  101. elapsed = elapsed + deltaTime
  102. local shakeOffset = Vector3.new(
  103. math.random() * intensity - (intensity / 2),
  104. math.random() * intensity - (intensity / 2),
  105. math.random() * intensity - (intensity / 2)
  106. )
  107. Camera.CFrame = CFrame.new(basePosition + shakeOffset)
  108. else
  109. shakeConnection:Disconnect()
  110. end
  111. end)
  112. end
  113.  
  114. local function createExplosion(position)
  115. local explosion = Instance.new("Explosion")
  116. explosion.Position = position
  117. explosion.BlastRadius = 20
  118. explosion.BlastPressure = 100000
  119. explosion.Parent = workspace
  120.  
  121. local shockwave = Instance.new("Part")
  122. shockwave.Shape = Enum.PartType.Cylinder
  123. shockwave.Size = Vector3.new(1, 50, 50)
  124. shockwave.Anchored = true
  125. shockwave.CanCollide = false
  126. shockwave.BrickColor = BrickColor.new("Light blue")
  127. shockwave.Transparency = 0.5
  128. shockwave.CFrame = CFrame.new(position) * CFrame.Angles(math.pi / 2, 0, 0)
  129. shockwave.Parent = workspace
  130.  
  131. local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear)
  132. local shockwaveTween = TweenService:Create(shockwave, tweenInfo, {Size = Vector3.new(1, 150, 150), Transparency = 1})
  133. shockwaveTween:Play()
  134.  
  135. Debris:AddItem(shockwave, 1.5)
  136.  
  137. local flash = Instance.new("PointLight")
  138. flash.Brightness = 50
  139. flash.Range = 150
  140. flash.Color = Color3.fromRGB(255, 255, 255)
  141. flash.Parent = ball
  142. Debris:AddItem(flash, 0.5)
  143.  
  144. local explosionSound = Instance.new("Sound")
  145. explosionSound.SoundId = "rbxassetid://142376088"
  146. explosionSound.Parent = ball
  147. explosionSound:Play()
  148.  
  149. screenShake(1, 0.5)
  150.  
  151. wait(2)
  152. if ball then
  153. ball:Destroy()
  154. end
  155. end
  156.  
  157. local function growBall()
  158. while running do
  159. wait(growTime)
  160.  
  161. if ball.Size.Magnitude < maxSize.Magnitude then
  162. ball.Size = ball.Size + Vector3.new(growAmount, growAmount, growAmount)
  163. ball.Position = head.Position + Vector3.new(0, 10 + ball.Size.Y / 2, 0)
  164. else
  165. running = false
  166. ball.Anchored = false
  167. ball.CanCollide = false
  168.  
  169. local forwardVector = humanoidRootPart.CFrame.LookVector
  170. local velocity = forwardVector * 150 + Vector3.new(0, -100, 0)
  171. ball.Velocity = velocity
  172.  
  173. for i = 1, 5 do
  174. wait(0.1)
  175. createLightning(ball.Position, ball.Position + Vector3.new(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5)))
  176. end
  177. end
  178. end
  179. end
  180.  
  181. local function detectGroundHit()
  182. while ball and ball.Parent do
  183. local rayOrigin = ball.Position
  184. local rayDirection = Vector3.new(0, -10, 0)
  185.  
  186. local raycastParams = RaycastParams.new()
  187. raycastParams.FilterDescendantsInstances = {player.Character}
  188. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  189.  
  190. local result = workspace:Raycast(rayOrigin, rayDirection, raycastParams)
  191.  
  192. if result and (ball.Position - result.Position).Magnitude < 5 then
  193. createExplosion(ball.Position)
  194. return
  195. end
  196.  
  197. wait(0.05)
  198. end
  199. end
  200.  
  201. spawn(growBall)
  202. spawn(detectGroundHit)
  203.  
  204. character.Humanoid.Died:Connect(function()
  205. running = false
  206. if ball then
  207. ball:Destroy()
  208. end
  209. humanoidRootPart.Anchored = false
  210. end)
  211.  
  212. local function bringPlayerDown()
  213. floating = false
  214. humanoidRootPart.Anchored = true
  215. local landingTweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  216. local landingTween = TweenService:Create(humanoidRootPart, landingTweenInfo, {CFrame = humanoidRootPart.CFrame - Vector3.new(0, hoverHeight, 0)})
  217. landingTween:Play()
  218.  
  219. landingTween.Completed:Connect(function()
  220. humanoidRootPart.Anchored = false
  221. end)
  222. end
  223.  
  224. RunService.Stepped:Connect(function()
  225. if not running then
  226. humanoidRootPart.Anchored = false
  227. bringPlayerDown()
  228. end
  229. end)
  230.  
  231. screenShake(1, 1)
  232.  
  233. for i = 1, 5 do
  234. wait(0.3)
  235. local randomPos = ball.Position + Vector3.new(math.random(-30, 30), 0, math.random(-30, 30))
  236. createLightning(randomPos, randomPos + Vector3.new(math.random(-5, 5), -10, math.random(-5, 5)))
  237. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement