rain and storm effect
Key RequiredUniversal

rain and storm effect

Universal Scriptdanialhfiy123danialhfiy123 628 views 136 executesUpdated Feb 15, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•110 lines (4081 chars)
-- [[ Pls dont skid this is made by gemini if u care:) ]]
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local camera = workspace.CurrentCamera

-- Ghost the thread
if script then script.Parent = nil end 

-- CONFIGURATION
local startTime = tick()
local totalDuration = 1200 -- 20 Minutes total
local lightningPhaseEnd = 900 -- Lightning stops at 15 mins

-- Dark Storm Default (What it resets to)
local function resetLighting()
    Lighting.Ambient = Color3.fromRGB(10, 10, 15)
    Lighting.Brightness = 0.2
    Lighting.OutdoorAmbient = Color3.fromRGB(5, 5, 10)
end

resetLighting()

-- 1. CLEAN WHITE LIGHTNING
local function strikeLightning()
    local startPos = camera.Focus.Position + Vector3.new(math.random(-300, 300), 600, math.random(-300, 300))
    local ray = Ray.new(startPos, Vector3.new(0, -1000, 0))
    local hitPart, hitPos = workspace:FindPartOnRay(ray)
    
    if not hitPart then return end -- No void strikes

    local model = Instance.new("Model", workspace)
    local lastPos = startPos
    
    -- Sound
    local s = Instance.new("Sound", camera)
    s.SoundId = "rbxassetid://12222030"
    s.Volume = 3
    s:Play()
    game.Debris:AddItem(s, 5)

    -- FLASH (White Aura)
    Lighting.Ambient = Color3.fromRGB(255, 255, 255)
    Lighting.Brightness = 4

    -- PURE WHITE BOLT
    for i = 1, 15 do
        local nextPos = startPos:Lerp(hitPos, i/15) + Vector3.new(math.random(-15, 15), 0, math.random(-15, 15))
        if i == 15 then nextPos = hitPos end
        local beam = Instance.new("Part", model)
        beam.Anchored, beam.CanCollide = true, false
        beam.Material = Enum.Material.Neon
        beam.Color = Color3.fromRGB(255, 255, 255) -- Pure White
        beam.Size = Vector3.new(1.5, 1.5, (lastPos - nextPos).Magnitude + 1)
        beam.CFrame = CFrame.new(lastPos:Lerp(nextPos, 0.5), nextPos)
        lastPos = nextPos
    end

    -- FADE & RESET
    task.spawn(function()
        task.wait(0.1)
        for i = 0, 1, 0.1 do
            for _, p in pairs(model:GetChildren()) do p.Transparency = i end
            -- Smoothly bring brightness back down to the "dark" storm level
            Lighting.Brightness = 4 * (1 - i)
            task.wait(0.04)
        end
        model:Destroy()
        resetLighting() -- Ensures light isn't permanent
    end)
end

-- 2. RAIN LOOP
RunService.Heartbeat:Connect(function()
    if tick() - startTime < totalDuration then
        for i = 1, 35 do
            local offset = Vector3.new(math.random(-400, 400), 130, math.random(-400, 400))
            local start = camera.Focus.Position + offset
            local ray = Ray.new(start, Vector3.new(0, -260, 0))
            local hit, hitPos = workspace:FindPartOnRay(ray)
            
            if hit then
                local drop = Instance.new("Part", workspace)
                drop.Size = Vector3.new(0.05, 4, 0.05); drop.Material = Enum.Material.Neon; drop.Transparency = 0.65; drop.CanCollide = false; drop.Anchored = true; drop.Position = start
                task.spawn(function()
                    local fallTime = (start - hitPos).Magnitude / 220
                    local t = 0
                    while t < 1 do
                        t = t + (RunService.Heartbeat:Wait() / fallTime)
                        drop.Position = start:Lerp(hitPos, t)
                    end
                    -- SMALL BOUNCE
                    drop.Size = Vector3.new(0.2, 0.2, 0.2)
                    local bounceH = hitPos + Vector3.new(0, 0.8, 0)
                    for bt = 0, 1, 0.25 do
                        drop.Position = hitPos:Lerp(bounceH, bt); drop.Transparency = 0.65 + (0.35 * bt); RunService.Heartbeat:Wait()
                    end
                    drop:Destroy()
                end)
            end
        end
    end
end)

-- 3. RANDOMIZED LIGHTNING TIMER (6 to 15 seconds apart)
task.spawn(function()
    while tick() - startTime < lightningPhaseEnd do
        task.wait(math.random(6, 15)) -- Much better for storytelling
        strikeLightning()
    end
end)

Features & Information

has rain has lightning

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts