Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local TweenService = game:GetService("TweenService")
- local Debris = game:GetService("Debris")
- local Camera = game.Workspace.CurrentCamera
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- local hoverHeight = 10
- local hoverSpeed = 0.5
- local floating = true
- local function floatPlayer()
- local originalPos = humanoidRootPart.Position
- local hoverDirection = 1
- local hoverOffset = 0
- RunService.Heartbeat:Connect(function()
- if floating then
- hoverOffset = math.sin(tick() * hoverSpeed) * hoverDirection
- humanoidRootPart.CFrame = CFrame.new(originalPos + Vector3.new(0, hoverHeight + hoverOffset, 0))
- end
- end)
- end
- humanoidRootPart.Anchored = true
- floatPlayer()
- local ball = Instance.new("Part")
- ball.Shape = Enum.PartType.Ball
- ball.Size = Vector3.new(5, 5, 5)
- ball.Anchored = true
- ball.CanCollide = false
- ball.CastShadow = false
- ball.BrickColor = BrickColor.new("Light blue")
- ball.Transparency = 0.1
- local light = Instance.new("PointLight")
- light.Parent = ball
- light.Brightness = 20
- light.Range = 80
- light.Color = Color3.fromRGB(0, 170, 255)
- local particleEmitter = Instance.new("ParticleEmitter")
- particleEmitter.Texture = "rbxassetid://243660364"
- particleEmitter.Rate = 250
- particleEmitter.Speed = NumberRange.new(10, 20)
- particleEmitter.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 7), NumberSequenceKeypoint.new(1, 15)})
- particleEmitter.Lifetime = NumberRange.new(0.5, 1.2)
- particleEmitter.LightInfluence = 1
- particleEmitter.Rotation = NumberRange.new(0, 360)
- particleEmitter.Parent = ball
- local sparksEmitter = Instance.new("ParticleEmitter")
- sparksEmitter.Texture = "rbxassetid://3611072548"
- sparksEmitter.Rate = 100
- sparksEmitter.Speed = NumberRange.new(5, 15)
- sparksEmitter.Size = NumberSequence.new(3)
- sparksEmitter.Lifetime = NumberRange.new(0.2, 0.5)
- sparksEmitter.Parent = ball
- local function createLightning(position, targetPosition)
- local beam = Instance.new("Part")
- beam.Size = Vector3.new(0.2, 0.2, (position - targetPosition).Magnitude)
- beam.Anchored = true
- beam.CanCollide = false
- beam.Material = Enum.Material.Neon
- beam.Color = Color3.fromRGB(255, 255, 0)
- beam.CFrame = CFrame.new(position, targetPosition) * CFrame.new(0, 0, -beam.Size.Z / 2)
- beam.Parent = workspace
- local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
- local tween = TweenService:Create(beam, tweenInfo, {Transparency = 1})
- tween:Play()
- Debris:AddItem(beam, 0.2)
- end
- local rotationSpeed = 2
- RunService.Heartbeat:Connect(function()
- ball.CFrame = ball.CFrame * CFrame.Angles(0, math.rad(rotationSpeed), 0)
- end)
- local head = character:WaitForChild("Head")
- ball.Position = head.Position + Vector3.new(0, 10 + ball.Size.Y / 2, 0)
- ball.Parent = workspace
- local growTime = 0.05
- local growAmount = 0.8
- local maxSize = Vector3.new(60, 60, 60)
- local running = true
- local function screenShake(duration, intensity)
- local elapsed = 0
- local basePosition = Camera.CFrame.Position
- local shakeConnection
- shakeConnection = RunService.RenderStepped:Connect(function(deltaTime)
- if elapsed < duration then
- elapsed = elapsed + deltaTime
- local shakeOffset = Vector3.new(
- math.random() * intensity - (intensity / 2),
- math.random() * intensity - (intensity / 2),
- math.random() * intensity - (intensity / 2)
- )
- Camera.CFrame = CFrame.new(basePosition + shakeOffset)
- else
- shakeConnection:Disconnect()
- end
- end)
- end
- local function createExplosion(position)
- local explosion = Instance.new("Explosion")
- explosion.Position = position
- explosion.BlastRadius = 20
- explosion.BlastPressure = 100000
- explosion.Parent = workspace
- local shockwave = Instance.new("Part")
- shockwave.Shape = Enum.PartType.Cylinder
- shockwave.Size = Vector3.new(1, 50, 50)
- shockwave.Anchored = true
- shockwave.CanCollide = false
- shockwave.BrickColor = BrickColor.new("Light blue")
- shockwave.Transparency = 0.5
- shockwave.CFrame = CFrame.new(position) * CFrame.Angles(math.pi / 2, 0, 0)
- shockwave.Parent = workspace
- local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear)
- local shockwaveTween = TweenService:Create(shockwave, tweenInfo, {Size = Vector3.new(1, 150, 150), Transparency = 1})
- shockwaveTween:Play()
- Debris:AddItem(shockwave, 1.5)
- local flash = Instance.new("PointLight")
- flash.Brightness = 50
- flash.Range = 150
- flash.Color = Color3.fromRGB(255, 255, 255)
- flash.Parent = ball
- Debris:AddItem(flash, 0.5)
- local explosionSound = Instance.new("Sound")
- explosionSound.SoundId = "rbxassetid://142376088"
- explosionSound.Parent = ball
- explosionSound:Play()
- screenShake(1, 0.5)
- wait(2)
- if ball then
- ball:Destroy()
- end
- end
- local function growBall()
- while running do
- wait(growTime)
- if ball.Size.Magnitude < maxSize.Magnitude then
- ball.Size = ball.Size + Vector3.new(growAmount, growAmount, growAmount)
- ball.Position = head.Position + Vector3.new(0, 10 + ball.Size.Y / 2, 0)
- else
- running = false
- ball.Anchored = false
- ball.CanCollide = false
- local forwardVector = humanoidRootPart.CFrame.LookVector
- local velocity = forwardVector * 150 + Vector3.new(0, -100, 0)
- ball.Velocity = velocity
- for i = 1, 5 do
- wait(0.1)
- createLightning(ball.Position, ball.Position + Vector3.new(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5)))
- end
- end
- end
- end
- local function detectGroundHit()
- while ball and ball.Parent do
- local rayOrigin = ball.Position
- local rayDirection = Vector3.new(0, -10, 0)
- local raycastParams = RaycastParams.new()
- raycastParams.FilterDescendantsInstances = {player.Character}
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- local result = workspace:Raycast(rayOrigin, rayDirection, raycastParams)
- if result and (ball.Position - result.Position).Magnitude < 5 then
- createExplosion(ball.Position)
- return
- end
- wait(0.05)
- end
- end
- spawn(growBall)
- spawn(detectGroundHit)
- character.Humanoid.Died:Connect(function()
- running = false
- if ball then
- ball:Destroy()
- end
- humanoidRootPart.Anchored = false
- end)
- local function bringPlayerDown()
- floating = false
- humanoidRootPart.Anchored = true
- local landingTweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- local landingTween = TweenService:Create(humanoidRootPart, landingTweenInfo, {CFrame = humanoidRootPart.CFrame - Vector3.new(0, hoverHeight, 0)})
- landingTween:Play()
- landingTween.Completed:Connect(function()
- humanoidRootPart.Anchored = false
- end)
- end
- RunService.Stepped:Connect(function()
- if not running then
- humanoidRootPart.Anchored = false
- bringPlayerDown()
- end
- end)
- screenShake(1, 1)
- for i = 1, 5 do
- wait(0.3)
- local randomPos = ball.Position + Vector3.new(math.random(-30, 30), 0, math.random(-30, 30))
- createLightning(randomPos, randomPos + Vector3.new(math.random(-5, 5), -10, math.random(-5, 5)))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement