-- [[ ASSET CONFIGURATION ]] -- local HOUSE_MODEL_ID = "rbxassetid://12222163756" -- parts inside named 1 to 5 break at matching EF levels local TEXTURE_ID = "rbxassetid://128978037408493" -- new particle texture local TORNADO_SOUND_ID = "rbxassetid://123731555496199" local CRASH_SOUND_ID = "rbxassetid://138817960173178" local RAIN_SOUND_ID = "rbxassetid://137061816250912" local THUNDER_SOUND_IDS = { "rbxassetid://80382122526396", "rbxassetid://1079408535", "rbxassetid://123469822942802", } -- [[ STORM TIMELINE ]] -- local TIMELINE = { SupercellSeconds = 180, -- total time for the supercell to build CloudFadeIn = 4, -- cloud particle fade-in speed DelayMin = 8, -- wait time after supercell forms before tornado forms DelayMax = 45, DescendSeconds = 35, -- funnel descent speed FormDistMin = 1500, -- spawn distance from player FormDistMax = 3500, } -- [[ WINDSPEED (realistic lifecycle) ]] -- local WIND = { StartMPH = 68, -- initial wind speed at EF0 RiseRate = 1.2, -- max mph gained per second FallRate = 0.8, -- max mph lost per second PeakMin = 90, -- tornado peak speed range PeakMax = 250, PeakBias = 1.8, Wobble = 0.04, DriftEvery = {45, 100}, } -- [[ CARS & HEAVY OBJECTS ]] -- local CARS = { MinEF = 1, HeavyMass = 250, MaxCars = 10, CarryMin = 6, CarryMax = 12, ThrowAccel = 700, ThrowTime = 0.6, ThrowUp = 260, Cooldown = 25, } -- [[ EF BEHAVIOR MATRIX ]] -- local EF_BEHAVIOR = { [0] = {air = false, pull = 4, orbit = 30, liftFrac = 0.5, damp = 0.95}, [1] = {air = false, pull = 8, orbit = 75, liftFrac = 0.4, damp = 0.94}, [2] = {air = false, pull = 9, orbit = 85, liftFrac = 0.4, damp = 0.95, tossEvery = {2.0, 4.5}, tossTime = 0.35, tossPower = 140}, [3] = {air = true, pull = 12, orbit = 180, height = 0.35, damp = 0.82, tossEvery = {1.2, 2.5}, tossTime = 0.4, tossPower = 200}, [4] = {air = true, pull = 15, orbit = 230, height = 0.50, damp = 0.82, tossEvery = {0.7, 1.8}, tossTime = 0.4, tossPower = 260}, [5] = {air = true, pull = 18, orbit = 300, height = 0.65, damp = 0.84, tossEvery = {0.4, 1.2}, tossTime = 0.45, tossPower = 340}, } -- [[ PLAYER LIFT ]] -- local LIFT = { Enabled = true, Duration = 13, PullRange = 2.2, CatchRange = 0.85, PullMin = 20, PullMax = 90, OrbitSpeed = 140, MaxHeight = 0.7, RadiusFrac = 0.8, Cooldown = 25, ThrowSpeed = 420, ThrowUp = 220, PullGain = 4, PullLiftFrac = 0.7, } -- [[ INSIDE TORNADO VISUALS ]] -- local INSIDE = { FogColor = Color3.fromRGB(160, 165, 175), FogStart = 0, FogEnd = 300, AtmDensity = 0.75, Tint = Color3.fromRGB(190, 195, 205), ShakeRot = 0.02, ShakePos = 0.6, } -- [[ PERFORMANCE & QUALITY ]] -- local QUALITY = 0.6 local MAX_DEBRIS = 150 local DESTROY_BUILDINGS = true local FUNNEL_PARTS = math.max(60, math.floor(520 * QUALITY)) local FIXED_HEIGHT = 1600 local CLOUD_CLEARNESS = 0.05 local SPIN_SPEED = 1.5 local MOVE_SPEED = 1.7 -- [[ RADAR CONFIGURATION ]] -- local RADAR = { Range = 24000, PlateSize = 360, Grid = math.max(28, math.floor(60 * QUALITY)), ScanSpeed = 80, WallHeight = 60, RoomPos = Vector3.new(0, 20000, 0), active = false, realCamPos = Vector3.zero, } local TOOLS = {} -- [[ TORNADO SIRENS ]] -- local SIREN = { SoundId = "rbxassetid://94829950450943", Count = 3, MinDist = 250, MaxDist = 600, Volume = 4, FadeIn = 6, FadeOut = 9, ReverbDecay = 7, RollOffMin = 150, RollOffMax = 6000, AutoOnDescend = true, } -- [[ SUPERCELL STRUCTURE ]] -- local SUPERCELL_SCALE = 2.8 local CLOUD_BASE_OFFSET = 1400 local SUPERCELL_HEADING = Vector3.new(1, 0, 0.35).Unit local SC_COUNTS = { Shelf = 220, Wall = 70, Tower = 320, Anvil = 280, Top = 80, Flank = 90, Shaft = 100 } for k, v in pairs(SC_COUNTS) do SC_COUNTS[k] = math.max(8, math.floor(v * QUALITY)) end -- [[ FOG & SKY ]] -- local FOG_DENSITY = 0.12 local FOG_END = 40000 local TORNADO_COLOR = Color3.fromRGB(175, 178, 185) -- light grey local COLOR_BRIGHTNESS = 1.0 local BOTTOM_RATIO = 0.35 local BULB_AMOUNT = 0 local WEDGE_TOP_RADIUS = 1575 local TOP_FLARE = 1.1 local STICK_CHANCE = 0.30 local STICK_STRENGTH = 1.0 local OVERCAST_SKY = true -- [[ RAIN SETTINGS ]] -- local RAIN_ENABLED = true local RAIN_DROPS = math.max(200, math.floor(1500 * QUALITY)) local RAIN_RADIUS = 90 local RAIN_HEIGHT = 110 local RAIN_INTENSITY = 1.0 local RAIN_VOLUME = 2.2 local RAIN_FADE_IN = 8 local RAIN_FOG = true local RAIN_FOG_END = 22000 local RAIN_FOG_DENSITY = 0.03 local SHELTER_RADIUS = 28 -- [[ LIGHTNING SETTINGS ]] -- local LIGHTNING_ENABLED = true local LIGHTNING_MIN_DELAY = 2.5 local LIGHTNING_MAX_DELAY = 7 local LIGHTNING_RANGE = 3500 local THUNDER_SPEED = 1100 local BOLT_COLOR = Color3.fromRGB(200, 205, 215) local MULTI_VORTEX_ENABLED = false local AUTO_EF_BY_WINDSPEED = true -- [[ EF SETTINGS ]] -- local EF_SETTINGS = { [0] = {MinMPH=65, MaxMPH=85, BaseRadius=20, TopRadius=200, Height=1600, Speed=0.45, Move=0.08, Force=1500, DebrisSize=70, Name="EF0"}, [1] = {MinMPH=86, MaxMPH=110, BaseRadius=35, TopRadius=400, Height=1900, Speed=0.55, Move=0.12, Force=2800, DebrisSize=110, Name="EF1"}, [2] = {MinMPH=111, MaxMPH=135, BaseRadius=55, TopRadius=700, Height=2200, Speed=0.65, Move=0.18, Force=4500, DebrisSize=160, Name="EF2"}, [3] = {MinMPH=136, MaxMPH=165, BaseRadius=80, TopRadius=1000, Height=2600, Speed=0.75, Move=0.25, Force=7000, DebrisSize=230, Name="EF3"}, [4] = {MinMPH=166, MaxMPH=200, BaseRadius=115, TopRadius=1300, Height=3000, Speed=0.85, Move=0.35, Force=11000, DebrisSize=330, Name="EF4"}, [5] = {MinMPH=201, MaxMPH=318, BaseRadius=160, TopRadius=1575, Height=3500, Speed=1.00, Move=0.50, Force=16000, DebrisSize=480, Name="EF5"}, } local currentEF = 0 local currentWindSpeedMPH = 75 local peakWindSpeedMPH = 75 local angle = 0 local timeElapsed = 0 local frameCount = 0 local descendProgress = 0 local contact = 0 local insideBlend = 0 local windBase = WIND.StartMPH local windPeak = WIND.PeakMin + (WIND.PeakMax - WIND.PeakMin) * (math.random() ^ WIND.PeakBias) local windTarget = windPeak local nextWindShift = 0 local groundY = 0 local STORM_POS = Vector3.new(0, 0, 0) local liveStormPos = Vector3.new(0, 0, 0) local targetDirection = Vector3.new(1, 0, 1).Unit local nextDirChange = 0 local lightningFlash = 0 local strikeLightning local phase = "forming" local supercellTime = 0 local supercellProgress = 0 local formAt = 0 local tOffF = SUPERCELL_SCALE * (math.random() * 1100 - 700) local tOffS = SUPERCELL_SCALE * (math.random() * 1200 - 600) local RunService = game:GetService("RunService") local Lighting = game:GetService("Lighting") local Players = game:GetService("Players") local Player = Players.LocalPlayer local Debris = game:GetService("Debris") local UserInputService = game:GetService("UserInputService") local SoundService = game:GetService("SoundService") local sm = {} for k, v in pairs(EF_SETTINGS[0]) do sm[k] = v end if WEDGE_TOP_RADIUS then sm.TopRadius = WEDGE_TOP_RADIUS end if FIXED_HEIGHT then sm.Height = FIXED_HEIGHT end local windSm = {BaseRadius = 20, TopRadius = 1575, Height = 1600, MaxMPH = 85} -- [[ THIN EF0 / EF1 + LIGHT GREY FUNNEL ]] -- local THIN = {[0] = 0.22, [1] = 0.32} -- width multiplier at EF0/EF1; EF2+ keeps the original wide width (1) sm.WidthMul = THIN[0] local FUNNEL_COLOR = Color3.fromRGB(185, 185, 190) -- light grey funnel local DUST_COLOR = Color3.fromRGB(170, 168, 162) -- light grey-tan dust -- [[ UTILITIES ]] -- local function loadAsset(id) local ok, obj = pcall(function() return game:GetObjects(id)[1] end) return ok and obj or nil end local function getSpawnCFrame(x, z, model) local rayOrigin = Vector3.new(x, 1000, z) local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = {Player.Character} local result = workspace:Raycast(rayOrigin, Vector3.new(0, -2000, 0), params) local gy = result and result.Position.Y or 0 local _, size = model:GetBoundingBox() return CFrame.new(x, gy + (size.Y / 2), z) end local function isCharPart(p) local m = p:FindFirstAncestorOfClass("Model") return m ~= nil and m:FindFirstChildOfClass("Humanoid") ~= nil end local function getFocusPosition() if RADAR.active then return RADAR.realCamPos end local cam = workspace.CurrentCamera if cam then return cam.CFrame.Position end local char = Player.Character local root = char and char:FindFirstChild("HumanoidRootPart") return root and root.Position or Vector3.zero end do local char = Player.Character local rp = char and char:FindFirstChild("HumanoidRootPart") local center = getFocusPosition() local a = math.random() * math.pi * 2 local d = TIMELINE.FormDistMin + math.random() * (TIMELINE.FormDistMax - TIMELINE.FormDistMin) local sx, sz = center.X + math.cos(a) * d, center.Z + math.sin(a) * d local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = {Player.Character} local r = workspace:Raycast(Vector3.new(sx, 1000, sz), Vector3.new(0, -2000, 0), params) if r then groundY = r.Position.Y else groundY = rp and (rp.Position.Y - 3) or 0 end STORM_POS = Vector3.new(sx, groundY, sz) end local function applyStormSky() if not OVERCAST_SKY then return end pcall(function() Lighting.ClockTime = 12 Lighting.Brightness = 1.8 Lighting.Ambient = Color3.fromRGB(130, 133, 140) Lighting.OutdoorAmbient = Color3.fromRGB(145, 148, 155) Lighting.ExposureCompensation = -0.05 Lighting.FogColor = Color3.fromRGB(175, 180, 190) Lighting.FogStart = 4000 Lighting.FogEnd = FOG_END local atm = Lighting:FindFirstChildOfClass("Atmosphere") or Instance.new("Atmosphere", Lighting) atm.Density = FOG_DENSITY atm.Offset = 0.25 atm.Color = Color3.fromRGB(200, 205, 215) atm.Decay = Color3.fromRGB(170, 175, 185) atm.Glare = 0.2 atm.Haze = 0.3 local rays = Lighting:FindFirstChildOfClass("SunRays") or Instance.new("SunRays", Lighting) rays.Intensity = 0.15 rays.Spread = 0.8 end) end applyStormSky() local function calculateSpatialWindVector(worldPosition, stormCenter, efData, currentDescend) local relPos = worldPosition - stormCenter local horizontalDist = Vector3.new(relPos.X, 0, relPos.Z).Magnitude local heightY = math.clamp(relPos.Y, 0, efData.Height) if horizontalDist <= 0.001 then return Vector3.zero, 0 end local effectiveHeight = efData.Height * currentDescend local heightFactor = heightY / math.max(effectiveHeight, 10) local coreRadius = efData.BaseRadius + (heightFactor * (efData.TopRadius - efData.BaseRadius)) local radDir = Vector3.new(relPos.X, 0, relPos.Z).Unit local tangentDir = Vector3.new(-radDir.Z, 0, radDir.X) local velMagnitude if horizontalDist < coreRadius then velMagnitude = (horizontalDist / coreRadius) * efData.MaxMPH else velMagnitude = EF_SETTINGS[5].MaxMPH * (coreRadius / horizontalDist)^0.6 end local inflowMagnitude = velMagnitude * 0.4 local inflowDir = -radDir local updraftMagnitude = math.clamp(1 - (horizontalDist / (coreRadius * 2.2)), 0, 1) * (efData.MaxMPH * 0.5) local updraftDir = Vector3.new(0, 1, 0) local finalWindVector = (tangentDir * velMagnitude) + (inflowDir * inflowMagnitude) + (updraftDir * updraftMagnitude) local calculatedMPH = math.clamp(finalWindVector.Magnitude * currentDescend, 0, efData.MaxMPH * 1.1) return finalWindVector * currentDescend, calculatedMPH end local function spawnNeighborhood() local cam = workspace.CurrentCamera local look = cam and Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z) or Vector3.new(0, 0, 1) if look.Magnitude < 0.01 then look = Vector3.new(0, 0, 1) end local startPos = getFocusPosition() + look.Unit * 250 STORM_POS = Vector3.new(startPos.X, groundY, startPos.Z) for r = 1, 4 do for c = 1, 4 do task.spawn(function() local model = loadAsset(HOUSE_MODEL_ID) if model then model.Name = "SpawnedHouse" model.Parent = workspace local posX = startPos.X + (r * 130) - 260 local posZ = startPos.Z + (c * 130) - 260 model:PivotTo(getSpawnCFrame(posX, posZ, model) * CFrame.Angles(0, math.rad(math.random(360)), 0)) for _, p in ipairs(model:GetDescendants()) do if p:IsA("BasePart") then p.Name = tostring(math.random(1, 5)) p.Anchored = true end end end end) end end end local function clearHouses() for _, v in ipairs(workspace:GetChildren()) do if v.Name == "SpawnedHouse" then v:Destroy() end end end local function targetPlayerPosition() local targetPos = getFocusPosition() local delta = Vector3.new(targetPos.X - STORM_POS.X, 0, targetPos.Z - STORM_POS.Z) if delta.Magnitude > 1 then targetDirection = delta.Unit nextDirChange = timeElapsed + (delta.Magnitude / (EF_SETTINGS[currentEF].Move * 40 * MOVE_SPEED)) end end -- [[ GUI HUD & CONTROLS ]] -- local windHudLabel, efHudLabel, autoEfBtn local function createGui() local sg = Instance.new("ScreenGui") sg.Name = "TornadoControls" sg.ResetOnSpawn = false sg.Parent = Player.PlayerGui local hudFrame = Instance.new("Frame", sg) hudFrame.Size, hudFrame.Position = UDim2.new(0, 170, 0, 46), UDim2.new(1, -178, 0, 6) hudFrame.BackgroundColor3 = Color3.fromRGB(15, 15, 15) hudFrame.BackgroundTransparency = 0.25 Instance.new("UICorner", hudFrame) windHudLabel = Instance.new("TextLabel", hudFrame) windHudLabel.Size, windHudLabel.Position = UDim2.new(1, -8, 0, 24), UDim2.new(0, 5, 0, 2) windHudLabel.BackgroundTransparency = 1 windHudLabel.Text = "SUPERCELL FORMING" windHudLabel.TextColor3 = Color3.fromRGB(0, 255, 150) windHudLabel.Font = Enum.Font.SourceSansBold windHudLabel.TextSize = 14 windHudLabel.TextXAlignment = Enum.TextXAlignment.Left efHudLabel = Instance.new("TextLabel", hudFrame) efHudLabel.Size, efHudLabel.Position = UDim2.new(1, -8, 0, 18), UDim2.new(0, 5, 0, 25) efHudLabel.BackgroundTransparency = 1 efHudLabel.Text = "0% FORMED" efHudLabel.TextColor3 = Color3.fromRGB(255, 200, 0) efHudLabel.Font = Enum.Font.SourceSansBold efHudLabel.TextSize = 12 efHudLabel.TextXAlignment = Enum.TextXAlignment.Left local PANEL_W, PANEL_H = 150, 190 local container = Instance.new("Frame", sg) container.Size, container.Position = UDim2.new(0, PANEL_W, 0, PANEL_H), UDim2.new(0, 8, 0.2, 0) container.BackgroundColor3 = Color3.fromRGB(20, 20, 20) container.BackgroundTransparency = 0.1 Instance.new("UICorner", container) local titleBar = Instance.new("TextButton", container) titleBar.Size, titleBar.Position = UDim2.new(1, -28, 0, 20), UDim2.new(0, 0, 0, 0) titleBar.BackgroundTransparency = 1 titleBar.AutoButtonColor = false titleBar.Text = " STORM CONTROLS" titleBar.TextColor3 = Color3.fromRGB(200, 200, 200) titleBar.Font = Enum.Font.SourceSansBold titleBar.TextSize = 11 titleBar.TextXAlignment = Enum.TextXAlignment.Left local collapseBtn = Instance.new("TextButton", container) collapseBtn.Size, collapseBtn.Position = UDim2.new(0, 22, 0, 16), UDim2.new(1, -25, 0, 2) collapseBtn.BackgroundColor3 = Color3.fromRGB(50, 50, 50) collapseBtn.Text, collapseBtn.TextColor3, collapseBtn.Font, collapseBtn.TextSize = "-", Color3.new(1, 1, 1), Enum.Font.SourceSansBold, 14 Instance.new("UICorner", collapseBtn) local scroll = Instance.new("ScrollingFrame", container) scroll.Position, scroll.Size = UDim2.new(0, 3, 0, 22), UDim2.new(1, -6, 1, -25) scroll.BackgroundTransparency = 1 scroll.BorderSizePixel = 0 scroll.ScrollBarThickness = 4 scroll.CanvasSize = UDim2.new(0, 0, 0, 0) scroll.AutomaticCanvasSize = Enum.AutomaticSize.Y scroll.ScrollingDirection = Enum.ScrollingDirection.Y local layout = Instance.new("UIListLayout", scroll) layout.Padding = UDim.new(0, 3) layout.SortOrder = Enum.SortOrder.LayoutOrder local collapsed = false collapseBtn.MouseButton1Click:Connect(function() collapsed = not collapsed scroll.Visible = not collapsed container.Size = UDim2.new(0, PANEL_W, 0, collapsed and 22 or PANEL_H) collapseBtn.Text = collapsed and "+" or "-" end) local dragging, dragInput, dragStart, startPos titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = container.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) titleBar.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if input == dragInput and dragging then local delta = input.Position - dragStart container.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end) local order = 0 local function createBtn(text, color) order += 1 local btn = Instance.new("TextButton") btn.LayoutOrder = order btn.Size = UDim2.new(1, -6, 0, 20) btn.BackgroundColor3 = color btn.Text, btn.TextColor3, btn.Font, btn.TextSize = text, Color3.new(1, 1, 1), Enum.Font.SourceSansBold, 11 btn.Parent = scroll Instance.new("UICorner", btn) return btn end createBtn("FORM TORNADO NOW", Color3.fromRGB(160, 60, 160)).MouseButton1Click:Connect(function() if phase == "forming" or phase == "waiting" then phase = "descending" end end) createBtn("GOTO CAMERA", Color3.fromRGB(200, 50, 50)).MouseButton1Click:Connect(targetPlayerPosition) createBtn("EF CYCLE (MANUAL)", Color3.fromRGB(50, 50, 50)).MouseButton1Click:Connect(function() AUTO_EF_BY_WINDSPEED = false currentEF = (currentEF + 1) % 6 currentWindSpeedMPH = EF_SETTINGS[currentEF].MinMPH + 5 windBase = currentWindSpeedMPH if autoEfBtn then autoEfBtn.Text = "AUTO EF: OFF" end end) autoEfBtn = createBtn("AUTO EF: ON", Color3.fromRGB(0, 150, 100)) autoEfBtn.MouseButton1Click:Connect(function() AUTO_EF_BY_WINDSPEED = not AUTO_EF_BY_WINDSPEED if AUTO_EF_BY_WINDSPEED then windBase = currentWindSpeedMPH end autoEfBtn.Text = "AUTO EF: " .. (AUTO_EF_BY_WINDSPEED and "ON" or "OFF") end) createBtn("SPAWN HOUSES", Color3.fromRGB(0, 100, 200)).MouseButton1Click:Connect(spawnNeighborhood) createBtn("CLEAR HOUSES", Color3.fromRGB(200, 100, 0)).MouseButton1Click:Connect(clearHouses) local mvBtn = createBtn("MULTI-VORTEX: OFF", Color3.fromRGB(100, 0, 150)) mvBtn.MouseButton1Click:Connect(function() MULTI_VORTEX_ENABLED = not MULTI_VORTEX_ENABLED mvBtn.Text = "MULTI-VORTEX: " .. (MULTI_VORTEX_ENABLED and "ON" or "OFF") end) local rainBtn = createBtn("RAIN: " .. (RAIN_ENABLED and "ON" or "OFF"), Color3.fromRGB(40, 90, 160)) rainBtn.MouseButton1Click:Connect(function() RAIN_ENABLED = not RAIN_ENABLED rainBtn.Text = "RAIN: " .. (RAIN_ENABLED and "ON" or "OFF") end) local lightBtn = createBtn("LIGHTNING: " .. (LIGHTNING_ENABLED and "ON" or "OFF"), Color3.fromRGB(110, 110, 30)) lightBtn.MouseButton1Click:Connect(function() LIGHTNING_ENABLED = not LIGHTNING_ENABLED lightBtn.Text = "LIGHTNING: " .. (LIGHTNING_ENABLED and "ON" or "OFF") end) createBtn("STRIKE NOW", Color3.fromRGB(70, 70, 170)).MouseButton1Click:Connect(function() if strikeLightning then strikeLightning(false) end end) createBtn("DEPLOY PROBE", Color3.fromRGB(230, 140, 0)).MouseButton1Click:Connect(function() if TOOLS.deployProbe then TOOLS.deployProbe() end end) createBtn("CLEAR PROBES", Color3.fromRGB(150, 90, 0)).MouseButton1Click:Connect(function() if TOOLS.clearProbes then TOOLS.clearProbes() end end) createBtn("DEPLOY RADAR", Color3.fromRGB(30, 130, 90)).MouseButton1Click:Connect(function() if TOOLS.deployRadar then TOOLS.deployRadar() end end) createBtn("RADAR VIEW", Color3.fromRGB(20, 150, 210)).MouseButton1Click:Connect(function() if TOOLS.openRadar then TOOLS.openRadar() end end) createBtn("SIREN", Color3.fromRGB(190, 60, 30)).MouseButton1Click:Connect(function() if TOOLS.siren then TOOLS.siren() end end) createBtn("CLEAR ALL", Color3.fromRGB(150, 0, 0)).MouseButton1Click:Connect(clearHouses) end createGui() -- [[ HITBOXES & SOUND SETUP ]] -- local hitbox = Instance.new("Part", workspace) hitbox.Anchored, hitbox.CanCollide, hitbox.Transparency = true, false, 1 hitbox.CanQuery = false local orbitCube = Instance.new("Part", workspace) orbitCube.Anchored, orbitCube.CanCollide, orbitCube.Transparency = true, false, 1 orbitCube.CanQuery = false local funnelFolder = Instance.new("Folder", workspace) funnelFolder.Name = "TornadoAssets" local tornadoSound = Instance.new("Sound", hitbox) tornadoSound.SoundId = TORNADO_SOUND_ID tornadoSound.Looped = true tornadoSound.Volume = 0 tornadoSound.RollOffMaxDistance = 6000 tornadoSound.RollOffMinDistance = 150 tornadoSound:Play() local distortionEffect = Instance.new("DistortionSoundEffect", tornadoSound) distortionEffect.Level = 0.65 local function playBreakSound(position) local sndPart = Instance.new("Part", workspace) sndPart.Anchored = true sndPart.Transparency = 1 sndPart.CanCollide = false sndPart.Position = position local snd = Instance.new("Sound", sndPart) snd.SoundId = CRASH_SOUND_ID snd.Volume = math.random(8, 14) / 10 snd.PlaybackSpeed = math.random(90, 110) / 100 snd.RollOffMaxDistance = 2000 snd:Play() Debris:AddItem(sndPart, 4) end -- [[ PARTICLE FACTORY ]] -- local function createP(trans) local p = Instance.new("Part") p.Size = Vector3.new(1, 1, 1) p.Anchored, p.Transparency, p.CanCollide = true, 1, false p.CanQuery, p.CanTouch, p.CastShadow = false, false, false p.Parent = funnelFolder local bb = Instance.new("BillboardGui", p) bb.Size, bb.LightInfluence = UDim2.new(30, 0, 30, 0), 0 local img = Instance.new("ImageLabel", bb) img.Size, img.BackgroundTransparency, img.Image = UDim2.new(1, 0, 1, 0), 1, TEXTURE_ID img.ImageTransparency, img.Rotation = trans, math.random(360) return p, img, bb end local PARKED = CFrame.new(0, -10000, 0) local funnel = {} for i = 1, FUNNEL_PARTS do local p, img, bb = createP(1) p.CFrame = PARKED funnel[i] = { p = p, img = img, bb = bb, idx = i, pr = (((i - 1) + math.random()) / FUNNEL_PARTS) ^ 1.3, ang = math.random() * 360, rf = 0.5 + 0.5 * math.sqrt(math.random()), sizeMul = 0.95 + math.random() * 0.85, -- slightly larger base for better coverage shade = (math.random() - 0.5) * 0.08, seed = math.random() * 100, stick = math.random() < STICK_CHANCE, nextKick = math.random() * 5, ex = 0, exv = 0, boost = 0, } end local funnelHidden = true local funnelParts, funnelCFs = {}, {} for i, d in ipairs(funnel) do funnelParts[i] = d.p funnelCFs[i] = PARKED end local cloudBatchParts, cloudBatchCFs, lastCloudNb = {}, {}, 0 local subVortexParticles = {} for i = 1, math.max(30, math.floor(120 * QUALITY)) do local p, img, bb = createP(0.35) p.CFrame = PARKED table.insert(subVortexParticles, {p = p, img = img, bb = bb, pr = math.random(), ang = math.random() * 360, vIdx = (i % 3) + 1}) end local DC = {N = math.max(40, math.floor(220 * QUALITY)), list = {}, parts = {}, cfs = {}, parked = true} for i = 1, DC.N do local p, img, bb = createP(0.7) p.CFrame = PARKED img.ImageColor3 = Color3.fromRGB(160, 158, 152) DC.list[i] = { p = p, img = img, bb = bb, pr = math.random() ^ 1.5, ang = math.random() * 360, rf = 0.85 + math.random() * 0.6, sizeMul = 0.6 + math.random() * 0.9, rise = 0.5 + math.random(), seed = math.random() * 100, } DC.parts[i] = p DC.cfs[i] = PARKED end -- dust cloud around the tornado base local DUST = {N = math.max(40, math.floor(130 * QUALITY)), list = {}, parts = {}, cfs = {}, parked = true} for i = 1, DUST.N do local p, img, bb = createP(0.6) p.CFrame = PARKED img.ImageColor3 = DUST_COLOR DUST.list[i] = { p = p, img = img, bb = bb, ang = math.random() * 360, rr = 0.5 + math.random() * 1.5, hh = math.random() ^ 2, sizeMul = 0.7 + math.random() * 0.8, seed = math.random() * 100, spin = 0.6 + math.random() * 0.8, } DUST.parts[i] = p DUST.cfs[i] = PARKED end local clouds = {} local function addCloud(kind, d) local p, img, bb = createP(1) p.CFrame = PARKED d.kind, d.p, d.img, d.bb = kind, p, img, bb d.idx = #clouds + 1 d.seed = math.random() * 100 d.sizeMul = 0.8 + math.random() * 0.5 d.revealAt = math.huge clouds[d.idx] = d end for _ = 1, SC_COUNTS.Shelf do addCloud("shelf", {f = -7000 + 11500 * math.random(), sf = math.random() * 2 - 1, dy = math.random() * 300}) end for _ = 1, SC_COUNTS.Wall do addCloud("wall", {a = math.random() * math.pi * 2, rr = math.sqrt(math.random())}) end for _ = 1, SC_COUNTS.Tower do addCloud("tower", {h = math.random() ^ 0.85, a = math.random() * math.pi * 2, rf = 0.55 + 0.45 * math.sqrt(math.random())}) end for _ = 1, SC_COUNTS.Anvil do addCloud("anvil", {u = -0.3 + 1.3 * (math.random() ^ 0.85), sf = math.random() * 2 - 1, yo = math.random() * 2 - 1}) end for _ = 1, SC_COUNTS.Top do addCloud("top", {th = math.random() * math.pi * 2, ph = math.random(), rr = 0.45 + 0.55 * math.random()}) end for _ = 1, SC_COUNTS.Flank do addCloud("flank", {u = math.random(), so = math.random(), hh = math.random() ^ 1.2}) end for _ = 1, SC_COUNTS.Shaft do addCloud("shaft", {f = 1000 + 2600 * math.random(), s = (math.random() * 2 - 1) * 1500, hy = math.random()}) end do local prio = {shelf = 1, wall = 1, flank = 2, shaft = 2, tower = 3, anvil = 4, top = 5} local order = {} for i, d in ipairs(clouds) do order[i] = {d = d, key = prio[d.kind] + math.random() * 1.2} end table.sort(order, function(a, b) return a.key < b.key end) local interval = TIMELINE.SupercellSeconds / #order for rank, o in ipairs(order) do o.d.revealAt = (rank - 1) * interval end end local function tint(shade) local s = shade * COLOR_BRIGHTNESS * (1 + lightningFlash * 0.9) return Color3.new( math.clamp(FUNNEL_COLOR.R * s, 0, 1), math.clamp(FUNNEL_COLOR.G * s, 0, 1), math.clamp(FUNNEL_COLOR.B * s, 0, 1) ) end local CLOUD_DARK = Color3.new(TORNADO_COLOR.R * 0.55, TORNADO_COLOR.G * 0.55, TORNADO_COLOR.B * 0.55) local CLOUD_LIGHT = Color3.fromRGB(220, 223, 230) local function cloudTint(v) v = math.clamp(v + lightningFlash * 0.45, 0, 1) local c = CLOUD_DARK:Lerp(CLOUD_LIGHT, v) return Color3.new( math.clamp(c.R * COLOR_BRIGHTNESS, 0, 1), math.clamp(c.G * COLOR_BRIGHTNESS, 0, 1), math.clamp(c.B * COLOR_BRIGHTNESS, 0, 1) ) end local function columnRadius() return math.max(sm.TopRadius, 20) * BOTTOM_RATIO * sm.WidthMul end local function funnelRadius(pr) local col = columnRadius() local top = math.max(sm.TopRadius * sm.WidthMul, col + 10) local r = col + (top - col) * (pr ^ TOP_FLARE) local bulb = 1 + BULB_AMOUNT * math.exp(-(((pr - 0.16) / 0.12) ^ 2)) local round = 0.85 + 0.15 * math.sqrt(math.min(pr / 0.08, 1)) return r * bulb * round end -- [[ PLAYER SUCTION / LIFT SYSTEM ]] -- local victims = {} local cooldowns = {} local victimRay = RaycastParams.new() victimRay.FilterType = Enum.RaycastFilterType.Exclude local function clearPull(st, hum) if not st then return end if st.vf then st.vf:Destroy() st.vf = nil end if st.att then st.att:Destroy() st.att = nil end if st.ps and hum then hum.PlatformStand = false end st.ps = nil end local BEND = {tx = 0, tz = 0, sx = 0, sz = 0} local function bendAt(pr) local k = pr ^ 1.8 local s = math.sin(pr * 2.6 + timeElapsed * 0.22) * pr return BEND.tx * k + BEND.sx * s, BEND.tz * k + BEND.sz * s end local function updateVictims(dt, tPos, colR, widthScale) if not LIFT.Enabled then return end local groundR = colR * widthScale local pullRange = groundR * LIFT.PullRange local catchR = groundR * LIFT.CatchRange for _, plr in ipairs(Players:GetPlayers()) do local char = plr.Character local root = char and char:FindFirstChild("HumanoidRootPart") local hum = char and char:FindFirstChildOfClass("Humanoid") local st = victims[plr] if not root or not hum or hum.Health <= 0 then clearPull(st) victims[plr] = nil continue end local rel = Vector3.new(root.Position.X - tPos.X, 0, root.Position.Z - tPos.Z) local dist = rel.Magnitude if not st then if contact >= 0.6 and timeElapsed >= (cooldowns[plr] or 0) and dist < pullRange and (root.Position.Y - tPos.Y) < 500 then st = {mode = "pull"} victims[plr] = st end end if not st then continue end if st.mode == "pull" then if dist > pullRange * 1.3 then clearPull(st, hum) victims[plr] = nil elseif dist <= catchR then clearPull(st) st.mode = "lift" st.t = 0 st.ang = math.atan2(rel.Z, rel.X) st.rad = dist st.startRel = root.Position.Y - tPos.Y st.tx = (math.random() - 0.5) * 5 st.ty = (math.random() - 0.5) * 5 st.tz = (math.random() - 0.5) * 5 st.prev = root.Position st.yaw = select(2, root.CFrame:ToEulerAnglesYXZ()) hum.PlatformStand = true else local radDir = dist > 0.1 and (rel / dist) or Vector3.new(1, 0, 0) local tangent = Vector3.new(-radDir.Z, 0, radDir.X) local k = 1 - dist / pullRange local speed = LIFT.PullMin + (LIFT.PullMax - LIFT.PullMin) * k local want = -radDir * speed + tangent * speed * 0.5 if plr == Player then if not st.vf or not st.vf.Parent then clearPull(st) local att = Instance.new("Attachment") att.Name = "TornadoPullAtt" att.Parent = root local vf = Instance.new("VectorForce") vf.Name = "TornadoPullForce" vf.Attachment0, vf.RelativeTo = att, Enum.ActuatorRelativeTo.World vf.ApplyAtCenterOfMass = true vf.Force = Vector3.zero vf.Parent = root st.att, st.vf = att, vf hum.PlatformStand = true st.ps = true end local vel = root.AssemblyLinearVelocity local steer = (want - Vector3.new(vel.X, 0, vel.Z)) * LIFT.PullGain local mass = root.AssemblyMass st.vf.Force = Vector3.new(steer.X * mass, workspace.Gravity * LIFT.PullLiftFrac * mass, steer.Z * mass) else root.CFrame = root.CFrame + want * dt end end elseif st.mode == "lift" then st.t += dt local isMe = (plr == Player) local q = math.clamp(st.t / LIFT.Duration, 0, 1) local rise = 1 - (1 - q) ^ 2 local maxH = sm.Height * LIFT.MaxHeight local h = st.startRel + (maxH - st.startRel) * rise local pr = math.clamp(h / sm.Height, 0, 1) local targetRad = math.max(funnelRadius(pr) * widthScale * LIFT.RadiusFrac, 40) st.rad += (targetRad - st.rad) * (1 - math.exp(-dt * 1.5)) st.ang += (LIFT.OrbitSpeed / math.max(st.rad, 150)) * dt local bx, bz = bendAt(pr) local ax = tPos.X + bx local az = tPos.Z + bz local pos = Vector3.new( ax + math.cos(st.ang) * st.rad, tPos.Y + h + (isMe and 0 or math.sin(st.t * 2.3) * 12), az + math.sin(st.ang) * st.rad ) if isMe then root.CFrame = CFrame.new(pos) * CFrame.Angles(0, st.yaw, 0) else root.CFrame = CFrame.new(pos) * CFrame.Angles(st.t * st.tx, st.t * st.ty, st.t * st.tz) end root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero st.prev = pos if st.t >= LIFT.Duration then local radDir = Vector3.new(math.cos(st.ang), 0, math.sin(st.ang)) local tangent = Vector3.new(-math.sin(st.ang), 0, math.cos(st.ang)) local throwVel = radDir * (LIFT.ThrowSpeed * 0.8) + tangent * (LIFT.ThrowSpeed * 0.6) + Vector3.new(0, LIFT.ThrowUp, 0) root.CFrame = CFrame.new(pos) * CFrame.Angles(0, st.ang, 0) cooldowns[plr] = timeElapsed + LIFT.Cooldown if plr == Player then hum.PlatformStand = false hum:ChangeState(Enum.HumanoidStateType.Freefall) root.AssemblyLinearVelocity = throwVel victims[plr] = nil else st.mode = "fly" st.v = throwVel st.fly = 0 end end elseif st.mode == "fly" then st.fly += dt st.v += Vector3.new(0, -workspace.Gravity, 0) * dt local from = root.Position local step = st.v * dt victimRay.FilterDescendantsInstances = {char, funnelFolder} local hit = workspace:Raycast(from, step + step.Unit * 3, victimRay) if hit or st.fly > 8 then if hit then root.CFrame = CFrame.new(hit.Position + Vector3.new(0, 3, 0)) end root.AssemblyLinearVelocity = Vector3.zero hum.PlatformStand = false victims[plr] = nil else root.CFrame = CFrame.new(from + step) root.AssemblyLinearVelocity = Vector3.zero end end end end -- [[ PHYSICS & VECTORFORCE DEBRIS ]] -- local lastPhysicsUpdate = 0 local lastDebrisForce = 0 local lastCarUpdate = 0 local carTracked, carCount, carCooldown = {}, 0, {} local carCache = setmetatable({}, {__mode = "k"}) local function isCarAssembly(root) local c = carCache[root] if c ~= nil then return c end c = root:IsA("VehicleSeat") if not c then local ok, parts = pcall(function() return root:GetConnectedParts(true) end) if ok then for _, q in ipairs(parts) do if q:IsA("VehicleSeat") then c = true break end end end end if not c then local m = root:FindFirstAncestorOfClass("Model") for _ = 1, 3 do if not m or m == workspace then break end if m:FindFirstChildWhichIsA("VehicleSeat", true) and #m:GetDescendants() <= 600 then c = true break end m = m.Parent and m.Parent:FindFirstAncestorOfClass("Model") end end carCache[root] = c return c end local debrisTracked, debrisCount = {}, 0 local debrisOverlap = OverlapParams.new() debrisOverlap.FilterType = Enum.RaycastFilterType.Exclude local houseTracked, houseCount, lastHouseStep = {}, 0, 0 local HOUSE_MAX = 600 local HOUSE_FORCE_MUL = 1 -- EF Force pull (old script: 1) local HOUSE_WIND_MUL = 5 -- spatial wind multiplier (old script: 5) local HOUSE_LIFT_EVERY = 2 -- seconds between lift kicks local HOUSE_LIFT_MUL = 1.2 -- lift kick in gravities local HOUSE_MAX_SPEED = 350 local function computeForce(st, mass, pPos, rel, dist, stormPos, activeHeight) local b = EF_BEHAVIOR[currentEF] local g = workspace.Gravity if not st.seed then st.seed = math.random() * 100 st.nextToss = timeElapsed + 0.3 + math.random() * 1.5 end local radDir = rel / dist local tangentDir = Vector3.new(-radDir.Z, 0, radDir.X) -- Pull inward and spin around core local force = radDir * (math.log(dist + 1) * b.pull * mass) + tangentDir * (b.orbit * mass) if b.air then local targetHeight = stormPos.Y + activeHeight * b.height local diff = math.clamp((targetHeight - pPos.Y) * 0.25, -80, 160) local bob = math.sin(timeElapsed * 2.0 + st.seed) * 35 force += Vector3.new(0, (g * 0.96 + diff + bob) * mass, 0) else force += Vector3.new(0, g * b.liftFrac * mass, 0) end if b.tossEvery then if timeElapsed >= st.nextToss then st.nextToss = timeElapsed + b.tossEvery[1] + math.random() * (b.tossEvery[2] - b.tossEvery[1]) st.tossEnd = timeElapsed + b.tossTime if b.air then -- Violent random ejection outward from the vortex local ejectDir = (radDir + Vector3.new(math.random() - 0.5, math.random() * 0.5, math.random() - 0.5)).Unit st.tossVec = (ejectDir * b.tossPower + Vector3.new(0, b.tossPower * 0.5, 0)) else st.tossVec = Vector3.new( (math.random() * 2 - 1) * b.tossPower * 0.4, g * (1 - b.liftFrac) + b.tossPower, (math.random() * 2 - 1) * b.tossPower * 0.4 ) end end if st.tossEnd and timeElapsed < st.tossEnd and st.tossVec then force += st.tossVec * mass end end return force end local function dampPart(part, b) local v = part.AssemblyLinearVelocity if b.air then part.AssemblyLinearVelocity = v * b.damp else part.AssemblyLinearVelocity = Vector3.new(v.X * b.damp, v.Y, v.Z * b.damp) end end RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) timeElapsed += dt frameCount += 1 supercellTime = math.min(supercellTime + dt, TIMELINE.SupercellSeconds) supercellProgress = math.clamp(supercellTime / TIMELINE.SupercellSeconds, 0, 1) if phase == "forming" then if supercellProgress >= 1 then phase = "waiting" formAt = timeElapsed + TIMELINE.DelayMin + math.random() * (TIMELINE.DelayMax - TIMELINE.DelayMin) end elseif phase == "waiting" then if timeElapsed >= formAt then phase = "descending" end elseif phase == "descending" then local rate = (1 / TIMELINE.DescendSeconds) * math.clamp(0.7 + math.noise(timeElapsed * 0.4, 9.1) * 1.4, 0.15, 1.8) descendProgress = math.clamp(descendProgress + dt * rate, 0, 1) if descendProgress >= 1 then phase = "active" end end contact = math.clamp((descendProgress - 0.75) / 0.25, 0, 1) if AUTO_EF_BY_WINDSPEED then if phase == "active" then if timeElapsed >= nextWindShift then nextWindShift = timeElapsed + WIND.DriftEvery[1] + math.random() * (WIND.DriftEvery[2] - WIND.DriftEvery[1]) if math.random() < 0.25 then windPeak = math.clamp(windPeak + (math.random() - 0.4) * 60, WIND.PeakMin, WIND.PeakMax) end windTarget = math.clamp(windPeak * (0.8 + 0.2 * math.random()), WIND.StartMPH, 318) end windBase += math.clamp(windTarget - windBase, -WIND.FallRate * dt, WIND.RiseRate * dt) end currentWindSpeedMPH = windBase * (1 + math.noise(timeElapsed * 0.35, 33) * 2 * WIND.Wobble) for efLevel = 5, 0, -1 do if windBase >= EF_SETTINGS[efLevel].MinMPH then currentEF = efLevel break end end end if currentWindSpeedMPH > peakWindSpeedMPH then peakWindSpeedMPH = currentWindSpeedMPH end if windHudLabel and efHudLabel and frameCount % 10 == 0 then if phase == "forming" then windHudLabel.Text = "SUPERCELL FORMING" efHudLabel.Text = string.format("%d%% FORMED", math.floor(supercellProgress * 100)) elseif phase == "waiting" then windHudLabel.Text = "SUPERCELL READY" efHudLabel.Text = "WATCH THE SKY..." elseif phase == "descending" then windHudLabel.Text = "FUNNEL DESCENDING" efHudLabel.Text = string.format("%d%% TO GROUND", math.floor(descendProgress * 100)) else windHudLabel.Text = string.format("WINDSPEED: %d MPH", math.floor(currentWindSpeedMPH)) efHudLabel.Text = string.format("INTENSITY: %s (%s)", EF_SETTINGS[currentEF].Name, AUTO_EF_BY_WINDSPEED and "AUTO" or "MANUAL") end end local stats = EF_SETTINGS[currentEF] tornadoSound.Volume = (2.5 + (currentEF * 0.5)) * descendProgress tornadoSound.PlaybackSpeed = 0.9 + (currentEF * 0.03) local a = 1 - math.exp(-dt * 0.8) sm.BaseRadius += (stats.BaseRadius - sm.BaseRadius) * a sm.TopRadius += ((WEDGE_TOP_RADIUS or stats.TopRadius) - sm.TopRadius) * a sm.Height += ((FIXED_HEIGHT or stats.Height) - sm.Height) * a sm.MaxMPH = stats.MaxMPH sm.WidthMul += ((THIN[currentEF] or 1) - sm.WidthMul) * a if timeElapsed > nextDirChange then local rx, rz = math.random(-10, 10), math.random(-10, 10) if rx == 0 and rz == 0 then rx = 1 end targetDirection = Vector3.new(rx, 0, rz).Unit nextDirChange = timeElapsed + math.random(10, 20) end local moveMul = math.max(0.25, contact) STORM_POS += targetDirection * stats.Move * 40 * MOVE_SPEED * moveMul * dt local stormPos = STORM_POS + Vector3.new(math.noise(timeElapsed * 0.08, 1.5) * 50, 0, math.noise(1.5, timeElapsed * 0.08) * 50) liveStormPos = stormPos local activeHeight = math.max(sm.Height * descendProgress, 1) local lowEdge = sm.Height - activeHeight local widthScale = 0.4 + 0.6 * descendProgress local colR = columnRadius() hitbox.Size = Vector3.new(colR * 2.4, activeHeight, colR * 2.4) hitbox.Position = stormPos + Vector3.new(0, lowEdge + activeHeight / 2, 0) windSm.BaseRadius = colR windSm.TopRadius = math.max(sm.TopRadius, colR + 10) windSm.Height = sm.Height windSm.MaxMPH = stats.MaxMPH angle += dt * stats.Speed * SPIN_SPEED orbitCube.CFrame = hitbox.CFrame * CFrame.new(math.cos(angle) * colR * 0.8, -(activeHeight / 2) + 20, math.sin(angle) * colR * 0.8) -- Slow realistic bending for thin tornadoes do local sideDir = Vector3.new(-targetDirection.Z, 0, targetDirection.X) -- stronger lean on thin EF, gentler on high EF local leanAmp = sm.Height * math.max(0.14, 0.32 - currentEF * 0.045) local nA = math.noise(timeElapsed * 0.018, 12.7) -- slower primary sway local nB = math.noise(5.3, timeElapsed * 0.014) -- secondary slow curve local nC = math.noise(timeElapsed * 0.009, 3.1) * 0.55 -- very slow long-period curve local lean = -(0.45 + nA * 1.55 + nC) * leanAmp local sideLean = (nB + nC * 0.6) * leanAmp * 0.85 local topX = targetDirection.X * lean + sideDir.X * sideLean local topZ = targetDirection.Z * lean + sideDir.Z * sideLean local swayAmp = leanAmp * 0.22 * (0.55 + nB) -- much slower ease so thin tornadoes curve gradually local ease = 1 - math.exp(-dt * 0.055) BEND.tx += (topX - BEND.tx) * ease BEND.tz += (topZ - BEND.tz) * ease BEND.sx += (sideDir.X * swayAmp - BEND.sx) * ease BEND.sz += (sideDir.Z * swayAmp - BEND.sz) * ease end do local cam = workspace.CurrentCamera local target = 0 if cam and descendProgress > 0.5 then local cp = cam.CFrame.Position local camH = cp.Y - stormPos.Y if camH >= lowEdge and camH <= sm.Height then local pr = math.clamp((camH - lowEdge) / activeHeight, 0, 1) local bx, bz = bendAt(pr) local ax = stormPos.X + bx local az = stormPos.Z + bz local dist = math.sqrt((cp.X - ax) ^ 2 + (cp.Z - az) ^ 2) local r = funnelRadius(pr) * widthScale target = math.clamp((r - dist) / (r * 0.15), 0, 1) end end insideBlend += (target - insideBlend) * (1 - math.exp(-dt * 2.5)) end if descendProgress > 0.005 then funnelHidden = false local baseSpin = (4.0 + currentEF * 0.8) * SPIN_SPEED local fm = frameCount % 6 local funnelTrans = 0.35 + 0.65 * (1 - math.clamp(descendProgress * 3, 0, 1)) for _, d in ipairs(funnel) do local baseR = funnelRadius(d.pr) * widthScale local angVel = baseSpin * (1 + (1 - d.pr) * 1.0) if d.stick then d.nextKick -= dt if d.nextKick <= 0 then d.nextKick = 1.5 + math.random() * 4 d.exv += (1.2 + math.random() * 1.8) * STICK_STRENGTH d.boost += 0.6 + math.random() * 1.0 end d.exv += (-6 * d.ex - 1.6 * d.exv) * dt d.ex = math.clamp(d.ex + d.exv * dt, 0, 1.6 * STICK_STRENGTH) d.boost -= d.boost * 1.2 * dt angVel = angVel * (1 + d.boost) end d.ang += angVel * dt local rad = math.rad(d.ang) local r = baseR * d.rf * (1 + d.ex) local h = lowEdge + d.pr * activeHeight local bx, bz = bendAt(d.pr) funnelCFs[d.idx] = CFrame.new(stormPos + Vector3.new(math.cos(rad) * r + bx, h, math.sin(rad) * r + bz)) if d.idx % 6 == fm then -- bigger particles on thin tornadoes to cover gaps local thinBoost = (sm.WidthMul < 0.5) and 1.55 or 1.0 local sz = (math.max(baseR, colR * 0.6) * 0.9 + 110 * (0.4 + 0.6 * sm.WidthMul)) * d.sizeMul * (1 + d.ex * 0.35) * thinBoost d.bb.Size = UDim2.new(sz, 0, sz, 0) local shade = 0.88 + d.pr * 0.14 + d.shade + math.noise(timeElapsed * 0.2, d.seed) * 0.06 - currentEF * 0.012 + d.ex * 0.06 d.img.ImageColor3 = tint(math.clamp(shade, 0.7, 1.2)) d.img.ImageTransparency = funnelTrans end end workspace:BulkMoveTo(funnelParts, funnelCFs, Enum.BulkMoveMode.FireCFrameChanged) elseif not funnelHidden then funnelHidden = true for i = 1, #funnelCFs do funnelCFs[i] = PARKED end workspace:BulkMoveTo(funnelParts, funnelCFs, Enum.BulkMoveMode.FireCFrameChanged) end do local vis = math.clamp(contact, 0, 1) * math.clamp(0.35 + currentEF * 0.2, 0, 1) local activeN = math.floor(DC.N * vis) if activeN > 0 then DC.parked = false local spin = (5.0 + currentEF * 0.9) * SPIN_SPEED for i = 1, DC.N do local d = DC.list[i] if i > activeN then DC.cfs[i] = PARKED else d.pr += dt * (0.05 + 0.10 * (1 - d.pr)) * d.rise * (0.7 + currentEF * 0.12) if d.pr >= 1 then d.pr = 0 d.ang = math.random() * 360 d.rf = 0.85 + math.random() * 0.6 end d.ang += spin * (1 + (1 - d.pr) * 1.3) * (0.8 + d.rise * 0.2) * dt local rad = math.rad(d.ang) local baseR = funnelRadius(d.pr) * widthScale local r = baseR * d.rf + 25 local h = lowEdge + d.pr * activeHeight local bx, bz = bendAt(d.pr) DC.cfs[i] = CFrame.new(stormPos + Vector3.new(math.cos(rad) * r + bx, h, math.sin(rad) * r + bz)) if (i + frameCount) % 4 == 0 then local sz = (50 + baseR * 0.16) * d.sizeMul d.bb.Size = UDim2.new(sz, 0, sz, 0) local fade = math.min(d.pr / 0.08, 1) * math.min((1 - d.pr) / 0.15, 1) local tr = 0.58 + 0.2 * d.pr d.img.ImageTransparency = tr + (1 - tr) * (1 - fade) local sh = (0.85 + 0.3 * math.noise(timeElapsed * 0.2, d.seed)) * (1 + lightningFlash * 0.6) d.img.ImageColor3 = Color3.new( math.clamp(0.55 * sh, 0, 1), math.clamp(0.54 * sh, 0, 1), math.clamp(0.52 * sh, 0, 1)) end end end workspace:BulkMoveTo(DC.parts, DC.cfs, Enum.BulkMoveMode.FireCFrameChanged) elseif not DC.parked then DC.parked = true for i = 1, DC.N do DC.cfs[i] = PARKED end workspace:BulkMoveTo(DC.parts, DC.cfs, Enum.BulkMoveMode.FireCFrameChanged) end end do local vis = math.clamp(contact, 0, 1) local activeN = math.floor(DUST.N * vis) if activeN > 0 then DUST.parked = false local baseR = funnelRadius(0) * widthScale local skirt = baseR * 0.9 + 45 local spin = (2.5 + currentEF * 0.6) * SPIN_SPEED for i = 1, DUST.N do local d = DUST.list[i] if i > activeN then DUST.cfs[i] = PARKED else d.ang += spin * d.spin * dt * 2 local rad = math.rad(d.ang) local r = skirt * d.rr local h = 4 + d.hh * (40 + baseR * 0.5) + math.sin(timeElapsed * 0.8 + d.seed) * 6 DUST.cfs[i] = CFrame.new(stormPos + Vector3.new(math.cos(rad) * r, h, math.sin(rad) * r)) if (i + frameCount) % 4 == 0 then local sz = (skirt * 1.1 + 60) * d.sizeMul d.bb.Size = UDim2.new(sz, 0, sz, 0) local edge = math.clamp(1 - (d.rr - 0.5) / 1.5, 0, 1) local tr = 0.5 + 0.35 * (1 - edge) d.img.ImageTransparency = tr + (1 - tr) * (1 - vis) local sh = (0.9 + 0.2 * math.noise(timeElapsed * 0.15, d.seed)) * (1 + lightningFlash * 0.6) d.img.ImageColor3 = Color3.new( math.clamp(DUST_COLOR.R * sh, 0, 1), math.clamp(DUST_COLOR.G * sh, 0, 1), math.clamp(DUST_COLOR.B * sh, 0, 1)) end end end workspace:BulkMoveTo(DUST.parts, DUST.cfs, Enum.BulkMoveMode.FireCFrameChanged) elseif not DUST.parked then DUST.parked = true for i = 1, DUST.N do DUST.cfs[i] = PARKED end workspace:BulkMoveTo(DUST.parts, DUST.cfs, Enum.BulkMoveMode.FireCFrameChanged) end end for _, d in ipairs(subVortexParticles) do if MULTI_VORTEX_ENABLED and contact >= 0.5 then d.pr = (d.pr + dt * 0.06) % 1 local loopTime = (timeElapsed * 1.5) + (d.vIdx * (math.pi * 0.66)) local boomerangDist = sm.BaseRadius + (math.sin(loopTime) * (sm.BaseRadius * 1.8)) local subOrbitAngle = angle + (d.vIdx * (math.pi * 0.66)) local subCenter = stormPos + Vector3.new(math.cos(subOrbitAngle) * boomerangDist, 0, math.sin(subOrbitAngle) * boomerangDist) d.ang += (8 + currentEF * 2) * dt local rad = math.rad(d.ang) local subRadius = 8 + (d.pr * 25) local currentHeight = d.pr * (activeHeight * 0.4) d.p.CFrame = CFrame.new(subCenter + Vector3.new(math.cos(rad) * subRadius, currentHeight, math.sin(rad) * subRadius)) local sz = 80 + (d.pr * 180) d.bb.Size = UDim2.new(sz, 0, sz, 0) d.img.ImageColor3 = Color3.fromRGB(160, 162, 170) d.img.ImageTransparency = 0.35 d.parked = false elseif not d.parked then d.parked = true d.p.CFrame = PARKED end end local K = SUPERCELL_SCALE local fwd = SUPERCELL_HEADING local sideV = Vector3.new(-fwd.Z, 0, fwd.X) local baseY = sm.Height + CLOUD_BASE_OFFSET local towerH = 3700 * K local cm = frameCount % 3 local nb = 0 for _, d in ipairs(clouds) do local appear = math.clamp((supercellTime - d.revealAt) / TIMELINE.CloudFadeIn, 0, 1) if appear > 0 and (appear < 1 or d.idx % 3 == cm) then local kind = d.kind local F, S, Y, v, sz, tr if kind == "tower" then local h = d.h local ang = d.a + timeElapsed * (0.16 + 0.1 * h) local waist = (h < 0.5) and (1400 * (1 - 2 * h) ^ 2) or (1000 * (2 * h - 1) ^ 2) local R = K * (1500 + waist) * d.rf F = K * (600 + 1500 * h) + math.cos(ang) * R S = math.sin(ang) * R Y = baseY + h * towerH + math.sin(timeElapsed * 0.2 + d.seed) * 60 v = 0.18 + 0.6 * h + (d.rf - 0.7) * 0.15 sz = K * 1350 * d.sizeMul * (1 + 0.2 * h) tr = CLOUD_CLEARNESS + 0.08 + (1 - d.rf) * 0.15 elseif kind == "anvil" then local u = d.u local up = math.max(u, 0) local Wd if u < 0 then Wd = 150 + 3200 * math.sqrt(math.max(1 - (u / 0.3) ^ 2, 0)) else Wd = 150 + 3200 * (1 + 0.3 * math.sin(math.pi * math.min(u, 1) * 0.8)) * (1 - math.min(u, 1) ^ 2.2) end F = K * (2100 + 6500 * u) S = d.sf * Wd * K local thick = 700 * (1 - up ^ 0.6) + 120 Y = baseY + towerH + K * (thick * d.yo - 350 * up * up) + math.sin(timeElapsed * 0.1 + d.seed) * 40 v = 0.7 + 0.25 * (d.yo * 0.5 + 0.5) sz = K * 1500 * (1 - 0.4 * up) * d.sizeMul tr = CLOUD_CLEARNESS + 0.1 + 0.35 * up * up elseif kind == "top" then local th = d.th + timeElapsed * 0.12 local el = d.ph * (math.pi / 2) local rad = K * 1200 * d.rr + math.sin(timeElapsed * 0.3 + d.seed) * 50 F = K * 2100 + math.cos(th) * math.cos(el) * rad S = math.sin(th) * math.cos(el) * rad Y = baseY + towerH + K * 150 + math.sin(el) * rad v = 0.9 + 0.1 * math.sin(el) sz = K * 1000 * d.sizeMul tr = CLOUD_CLEARNESS + 0.03 elseif kind == "shelf" then F = K * d.f local t = math.clamp(-d.f / 7000, 0, 1) local Wd if d.f >= 0 then Wd = 3500 * math.sqrt(math.max(1 - (d.f / 4500) ^ 2, 0.05)) else Wd = 300 + 3200 * (1 - t) ^ 1.3 end S = d.sf * Wd * K - K * 2000 * t * t Y = baseY - d.dy * K + math.sin(timeElapsed * 0.15 + d.seed) * 35 v = 0.2 - 0.14 * (d.dy / 300) sz = K * 1900 * d.sizeMul tr = CLOUD_CLEARNESS + 0.05 elseif kind == "wall" then local ang = d.a + timeElapsed * 0.28 local R = K * 1350 * d.rr F = K * -150 + math.cos(ang) * R S = math.sin(ang) * R Y = baseY + K * (70 - 520 * (1 - d.rr ^ 1.5)) v = 0.04 + 0.1 * d.rr sz = K * 900 * d.sizeMul tr = CLOUD_CLEARNESS + 0.1 elseif kind == "flank" then local u = d.u F = K * (-2400 - 4600 * u) local tt = (2400 + 4600 * u) / 7000 S = K * (-2000 * tt * tt + (d.so * 2 - 1) * 700 * (1 - tt)) Y = baseY - K * 100 + d.hh * K * 1700 * (1 - 0.7 * u) v = 0.25 + 0.5 * d.hh sz = K * 650 * d.sizeMul tr = CLOUD_CLEARNESS + 0.15 else F = K * d.f + (1 - d.hy) * K * 300 S = d.s * K Y = d.hy * (baseY - 100) v = 0.3 + 0.1 * d.hy sz = K * 850 * d.sizeMul tr = 0.62 + 0.12 * d.hy end nb += 1 cloudBatchParts[nb] = d.p cloudBatchCFs[nb] = CFrame.new(stormPos + fwd * (F - tOffF) + sideV * (S - tOffS) + Vector3.new(0, Y, 0)) d.tick = (d.tick or 0) + 1 if appear < 1 or d.tick % 4 == 1 or lightningFlash > 0.02 then local ease = appear * appear * (3 - 2 * appear) local s = sz * (0.25 + 0.75 * ease) d.bb.Size = UDim2.new(s, 0, s, 0) d.img.ImageColor3 = cloudTint(v) d.img.ImageTransparency = tr + (1 - tr) * (1 - ease) end end end for i = nb + 1, lastCloudNb do cloudBatchParts[i] = nil cloudBatchCFs[i] = nil end lastCloudNb = nb if nb > 0 then workspace:BulkMoveTo(cloudBatchParts, cloudBatchCFs, Enum.BulkMoveMode.FireCFrameChanged) end updateVictims(dt, stormPos, colR, widthScale) -- [[ DESTRUCTION & VECTORFORCE AIR SUCTION / TOSSING ]] -- if contact > 0.4 and timeElapsed - lastPhysicsUpdate > 0.1 then lastPhysicsUpdate = timeElapsed local skip = {funnelFolder} local rf, bf = workspace:FindFirstChild("RainAssets"), workspace:FindFirstChild("LightningAssets") if rf then skip[#skip + 1] = rf end if bf then skip[#skip + 1] = bf end if Player.Character then skip[#skip + 1] = Player.Character end debrisOverlap.FilterDescendantsInstances = skip local soundBudget = 3 for _, p in ipairs(workspace:GetPartBoundsInBox(hitbox.CFrame, hitbox.Size, debrisOverlap)) do if debrisCount >= MAX_DEBRIS and carCount >= CARS.MaxCars then break end if not isCharPart(p) and p ~= hitbox and p ~= orbitCube and p.Parent ~= funnelFolder then local isHousePart = tonumber(p.Name) local shouldSuck = false if isHousePart and isHousePart >= 1 and isHousePart <= 5 and isHousePart % 1 == 0 then -- house parts are driven ONLY by the old suction logic below if isHousePart <= currentEF and not houseTracked[p] and houseCount < HOUSE_MAX then local wasAnchored = p.Anchored p.Anchored = false p:BreakJoints() for _, j in ipairs(p:GetJoints()) do pcall(function() j:Destroy() end) end for _, c in ipairs(p:GetChildren()) do if c:IsA("VectorForce") then c:Destroy() end end local att = Instance.new("Attachment") att.Name = "HouseSuctionAtt" att.Parent = p local vf = Instance.new("VectorForce") vf.Name = "HouseForce" vf.Attachment0 = att vf.RelativeTo = Enum.ActuatorRelativeTo.World vf.Force = Vector3.zero vf.Parent = p houseTracked[p] = {vf = vf, att = att, lastLift = timeElapsed} houseCount += 1 if wasAnchored and soundBudget > 0 and math.random(1, 4) == 1 then soundBudget -= 1 playBreakSound(p.Position) end end elseif not p.Anchored then shouldSuck = true end if shouldSuck then local aroot = p.AssemblyRootPart or p if aroot and (isCarAssembly(aroot) or aroot.AssemblyMass >= CARS.HeavyMass) then if currentEF >= CARS.MinEF and carCount < CARS.MaxCars and not carTracked[aroot] and timeElapsed >= (carCooldown[aroot] or 0) then local att = Instance.new("Attachment") att.Name = "TornadoCarAtt" att.Parent = aroot local vf = Instance.new("VectorForce") vf.Name = "TornadoCarForce" vf.Attachment0, vf.RelativeTo = att, Enum.ActuatorRelativeTo.World vf.Force = Vector3.zero vf.Parent = aroot carTracked[aroot] = { vf = vf, att = att, mode = "carry", throwAt = timeElapsed + CARS.CarryMin + math.random() * (CARS.CarryMax - CARS.CarryMin), } carCount += 1 end elseif debrisCount < MAX_DEBRIS and not debrisTracked[p] then if p.Anchored then p.Anchored = false p:BreakJoints() end if not p:FindFirstChild("TornadoForce") then local att = Instance.new("Attachment", p) local vf = Instance.new("VectorForce", p) vf.Name, vf.Attachment0, vf.RelativeTo = "TornadoForce", att, Enum.ActuatorRelativeTo.World debrisTracked[p] = {vf = vf, att = att} debrisCount += 1 end end end end end end if contact > 0.4 and timeElapsed - lastDebrisForce > 0.1 then lastDebrisForce = timeElapsed local maxDist = colR * 8 local b = EF_BEHAVIOR[currentEF] for p, st in pairs(debrisTracked) do local vf = st.vf local drop = false if not p.Parent or p.Anchored or not vf.Parent then drop = true else local mass = p:GetMass() local pPos = p.Position local bx, bz = bendAt(math.clamp((pPos.Y - stormPos.Y) / sm.Height, 0, 1)) local rel = Vector3.new(stormPos.X + bx - pPos.X, 0, stormPos.Z + bz - pPos.Z) local dist = rel.Magnitude if dist > maxDist then drop = true elseif dist > 0.1 then vf.Force = computeForce(st, mass, pPos, rel, dist, stormPos, activeHeight) dampPart(p, b) end end if drop then debrisTracked[p] = nil debrisCount -= 1 if vf and vf.Parent then vf:Destroy() end if st.att and st.att.Parent then st.att:Destroy() end end end end if next(carTracked) and timeElapsed - lastCarUpdate > 0.1 then lastCarUpdate = timeElapsed local maxDist = colR * 8 local b = EF_BEHAVIOR[currentEF] for root, c in pairs(carTracked) do local drop = false if not root.Parent or root.Anchored or not c.vf.Parent then drop = true else local mass = root.AssemblyMass local pPos = root.Position local bx, bz = bendAt(math.clamp((pPos.Y - stormPos.Y) / sm.Height, 0, 1)) local rel = Vector3.new(stormPos.X + bx - pPos.X, 0, stormPos.Z + bz - pPos.Z) local dist = rel.Magnitude if c.mode == "carry" then if dist > maxDist then drop = true elseif timeElapsed >= c.throwAt then if b.air then local outward = dist > 0.1 and (-rel / dist) or Vector3.new(1, 0, 0) local tangent = Vector3.new(outward.Z, 0, -outward.X) local dir = (outward * 0.8 + tangent * 0.6).Unit c.vf.Force = (dir * CARS.ThrowAccel + Vector3.new(0, workspace.Gravity + CARS.ThrowUp, 0)) * mass c.mode = "throw" c.endAt = timeElapsed + CARS.ThrowTime carCooldown[root] = timeElapsed + CARS.ThrowTime + CARS.Cooldown else drop = true carCooldown[root] = timeElapsed + CARS.Cooldown end elseif dist > 0.1 then c.vf.Force = computeForce(c, mass, pPos, rel, dist, stormPos, activeHeight) dampPart(root, b) end elseif timeElapsed >= c.endAt then drop = true end end if drop then carTracked[root] = nil carCount -= 1 carCooldown[root] = carCooldown[root] or (timeElapsed + 5) if c.vf and c.vf.Parent then c.vf:Destroy() end if c.att and c.att.Parent then c.att:Destroy() end end end end end) -- [[ RAIN & LIGHTNING SYSTEM ]] -- local rainFolder = Instance.new("Folder") rainFolder.Name = "RainAssets" rainFolder.Parent = workspace local boltFolder = Instance.new("Folder") boltFolder.Name = "LightningAssets" boltFolder.Parent = workspace local rayParams = RaycastParams.new() rayParams.FilterType = Enum.RaycastFilterType.Exclude local function rebuildFilter() local list = {funnelFolder, rainFolder, boltFolder} if Player.Character then table.insert(list, Player.Character) end rayParams.FilterDescendantsInstances = list end rebuildFilter() local baseBrightness = Lighting.Brightness local baseAmbient = Lighting.Ambient local baseOutdoor = Lighting.OutdoorAmbient local baseFogEnd = Lighting.FogEnd local baseFogStart = Lighting.FogStart local baseFogColor = Lighting.FogColor local atmosphere = Lighting:FindFirstChildOfClass("Atmosphere") local baseAtmDensity = atmosphere and atmosphere.Density or 0.3 local baseAtmColor = atmosphere and atmosphere.Color or Color3.new(1, 1, 1) local stormGrade = Instance.new("ColorCorrectionEffect") stormGrade.Name = "StormGrade" stormGrade.Parent = Lighting local HIDDEN_POS = Vector3.new(0, -100000, 0) local HIDDEN_CF = CFrame.new(HIDDEN_POS) local drops, dropParts, dropCFs = {}, {}, {} for i = 1, RAIN_DROPS do local p = Instance.new("Part") p.Anchored = true p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = false, false, false, false p.Material = Enum.Material.Neon p.Color = Color3.fromRGB(180, 185, 195) p.Transparency = 0.55 p.Size = Vector3.new(0.1, 0.1, 3 + math.random() * 2.5) p.CFrame = HIDDEN_CF p.Parent = rainFolder drops[i] = {pos = HIDDEN_POS, v = 0.85 + math.random() * 0.3} dropParts[i] = p dropCFs[i] = HIDDEN_CF end local rainSound = Instance.new("Sound") rainSound.Name = "RainLoop" rainSound.SoundId = RAIN_SOUND_ID rainSound.Looped = true rainSound.Volume = 0 rainSound.Parent = SoundService local rainEQ = Instance.new("EqualizerSoundEffect") rainEQ.Parent = rainSound rainSound:Play() local splashPlate = Instance.new("Part") splashPlate.Name = "RainSplashPlate" splashPlate.Anchored = true splashPlate.CanCollide, splashPlate.CanQuery, splashPlate.CanTouch, splashPlate.CastShadow = false, false, false, false splashPlate.Transparency = 1 splashPlate.Size = Vector3.new(RAIN_RADIUS * 2, 0.2, RAIN_RADIUS * 2) splashPlate.CFrame = HIDDEN_CF splashPlate.Parent = rainFolder local splash = Instance.new("ParticleEmitter") splash.Texture = "rbxasset://textures/particles/sparkles_main.dds" splash.Shape = Enum.ParticleEmitterShape.Box splash.ShapeStyle = Enum.ParticleEmitterShapeStyle.Surface splash.EmissionDirection = Enum.NormalId.Top splash.Lifetime = NumberRange.new(0.15, 0.3) splash.Speed = NumberRange.new(2, 6) splash.Acceleration = Vector3.new(0, -30, 0) splash.SpreadAngle = Vector2.new(35, 35) splash.Size = NumberSequence.new(0.5, 1.5) splash.Transparency = NumberSequence.new(0.45, 1) splash.Color = ColorSequence.new(Color3.fromRGB(200, 205, 215)) splash.LightEmission = 0.15 splash.Rotation = NumberRange.new(0, 360) splash.Rate = 0 splash.Parent = splashPlate local mist = Instance.new("ParticleEmitter") mist.Texture = "rbxasset://textures/particles/smoke_main.dds" mist.Shape = Enum.ParticleEmitterShape.Box mist.ShapeStyle = Enum.ParticleEmitterShapeStyle.Surface mist.EmissionDirection = Enum.NormalId.Top mist.Lifetime = NumberRange.new(3, 4.5) mist.Speed = NumberRange.new(1, 4) mist.Size = NumberSequence.new(18, 34) mist.Transparency = NumberSequence.new(0.93, 1) mist.Color = ColorSequence.new(Color3.fromRGB(170, 175, 185)) mist.Rotation = NumberRange.new(0, 360) mist.RotSpeed = NumberRange.new(-8, 8) mist.Rate = 0 mist.Parent = splashPlate local rainVel = Vector3.new(30, -210, 15) local rainIdle = false local rainFade = 0 local shelterBlend = 0 local sheltered = false local floorY = groundY local nextShelterCheck = 0 local nextStrikeTime = 3 local flashApplied = false local function respawnDrop(d, camPos, initial) local ang = math.random() * math.pi * 2 local r = RAIN_RADIUS * math.sqrt(math.random()) if sheltered and r < SHELTER_RADIUS then r = SHELTER_RADIUS + math.random() * (RAIN_RADIUS - SHELTER_RADIUS) end local topY = camPos.Y + RAIN_HEIGHT local y if initial then y = floorY + math.random() * math.max(topY - floorY, 1) else y = camPos.Y + RAIN_HEIGHT * (0.7 + 0.3 * math.random()) end local fallTime = math.max(y - floorY, 1) / math.max(-rainVel.Y, 40) local drift = Vector3.new(rainVel.X, 0, rainVel.Z) * fallTime * 0.5 d.pos = Vector3.new(camPos.X + math.cos(ang) * r, y, camPos.Z + math.sin(ang) * r) - drift end local function playThunder(dist, big) local delay = dist / THUNDER_SPEED task.delay(delay, function() local snd = Instance.new("Sound") snd.SoundId = THUNDER_SOUND_IDS[math.random(#THUNDER_SOUND_IDS)] snd.Volume = math.clamp(4.2 - dist / 1400, 0.8, 4.5) * (big and 1 or 0.7) snd.PlaybackSpeed = (dist < 600 and 1.0 or 0.88) + (math.random() - 0.5) * 0.12 local eq = Instance.new("EqualizerSoundEffect") eq.HighGain = -math.clamp(dist / 180, 0, 24) eq.Parent = snd snd.Parent = SoundService snd:Play() Debris:AddItem(snd, 30) end) end local function buildBolt(topPos, groundPos, camPos) local folder = Instance.new("Folder") folder.Name = "Bolt" local segs = {} local dist = (groundPos - camPos).Magnitude local thick = math.clamp(dist * 0.004, 1.5, 10) local function addSeg(a, b, t, color, baseTrans) local len = (b - a).Magnitude if len < 0.1 then return end local p = Instance.new("Part") p.Anchored = true p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = false, false, false, false p.Material = Enum.Material.Neon p.Color = color p.Size = Vector3.new(t, t, len) p.CFrame = CFrame.lookAt((a + b) / 2, b) p.Transparency = baseTrans p.Parent = folder segs[#segs + 1] = {p = p, base = baseTrans} end local function jaggedPath(a, b, n, amp) local pts = {a} local dir = b - a local u = dir.Unit for i = 1, n - 1 do local r = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5) r = (r - u * r:Dot(u)) * 2 * amp pts[#pts + 1] = a + dir * (i / n) + r end pts[#pts + 1] = b return pts end local function drawPath(pts, t) for i = 1, #pts - 1 do addSeg(pts[i], pts[i + 1], t, BOLT_COLOR, 0) addSeg(pts[i], pts[i + 1], t * 3.2, Color3.fromRGB(160, 175, 200), 0.75) end end local n = 18 local mainPts = jaggedPath(topPos, groundPos, n, ((topPos - groundPos).Magnitude / n) * 0.55) drawPath(mainPts, thick) for i = 3, #mainPts - 3 do if math.random() < 0.22 then local s = mainPts[i] local e = s + Vector3.new((math.random() - 0.5) * 800, -(250 + math.random() * 450), (math.random() - 0.5) * 800) drawPath(jaggedPath(s, e, 5, 28), thick * 0.45) end end local lightPart = Instance.new("Part") lightPart.Anchored = true lightPart.CanCollide, lightPart.CanQuery, lightPart.CanTouch = false, false, false lightPart.Transparency = 1 lightPart.Size = Vector3.new(1, 1, 1) lightPart.Position = groundPos + Vector3.new(0, 6, 0) lightPart.Parent = folder local pl = Instance.new("PointLight") pl.Color = Color3.fromRGB(190, 200, 215) pl.Range = 60 pl.Brightness = 0 pl.Parent = lightPart folder.Parent = boltFolder local function setBolt(dim) for _, s in ipairs(segs) do s.p.Transparency = s.base + (1 - s.base) * dim end pl.Brightness = 14 * (1 - dim) end return folder, setBolt end function strikeLightning(sheet) local cam = workspace.CurrentCamera if not cam then return end local camPos = RADAR.active and RADAR.realCamPos or cam.CFrame.Position if sheet then local sheetDist = 1200 + math.random() * 3000 task.spawn(function() for _ = 1, math.random(2, 4) do lightningFlash = math.max(lightningFlash, 0.35 + math.random() * 0.3) task.wait(0.06 + math.random() * 0.1) end end) playThunder(sheetDist, false) return end local fwdV = SUPERCELL_HEADING local sideV = Vector3.new(-fwdV.Z, 0, fwdV.X) local K = SUPERCELL_SCALE local tx, tz for _ = 1, 5 do local F = K * (-3000 + math.random() * 8000) local S = K * (math.random() * 2 - 1) * 3000 local wp = liveStormPos + fwdV * (F - tOffF) + sideV * (S - tOffS) tx, tz = wp.X, wp.Z if Vector2.new(tx - camPos.X, tz - camPos.Z).Magnitude <= LIGHTNING_RANGE then break end end rebuildFilter() local hit = workspace:Raycast(Vector3.new(tx, camPos.Y + 4000, tz), Vector3.new(0, -9000, 0), rayParams) local gy = hit and hit.Position.Y or groundY local ground = Vector3.new(tx, gy, tz) local cloudY = liveStormPos.Y + sm.Height + CLOUD_BASE_OFFSET local top = Vector3.new( tx + (math.random() - 0.5) * 400, math.max(cloudY + math.random() * 300 - 150, gy + 600), tz + (math.random() - 0.5) * 400 ) local dist = (ground - camPos).Magnitude local folder, setBolt = buildBolt(top, ground, camPos) local flashScale = math.clamp(1.15 - dist / 6000, 0.45, 1) task.spawn(function() local pulses = math.random(2, 4) for i = 1, pulses do local peak = (i == 1) and 1 or (0.5 + math.random() * 0.4) lightningFlash = math.max(lightningFlash, peak * flashScale) setBolt(0) task.wait(0.04 + math.random() * 0.05) setBolt(0.8) task.wait(0.03 + math.random() * 0.07) end setBolt(1) folder:Destroy() end) playThunder(dist, true) end RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) local cam = workspace.CurrentCamera if not cam then return end local camPos = RADAR.active and RADAR.realCamPos or cam.CFrame.Position local rainTarget = (RAIN_ENABLED and 1 or 0) * math.clamp((supercellProgress - 0.25) / 0.4, 0, 1) rainFade += math.clamp(rainTarget - rainFade, -dt / 2, dt / RAIN_FADE_IN) if timeElapsed >= nextShelterCheck then nextShelterCheck = timeElapsed + 0.15 rebuildFilter() local up = workspace:Raycast(camPos, Vector3.new(0, 70, 0), rayParams) sheltered = up ~= nil and up.Instance.Transparency < 0.8 local down = workspace:Raycast(camPos, Vector3.new(0, -300, 0), rayParams) floorY = down and down.Position.Y or (camPos.Y - 40) floorY = math.max(floorY, camPos.Y - 150) end local windVec = calculateSpatialWindVector(camPos, liveStormPos, windSm, contact) local ambientWind = targetDirection * 35 + Vector3.new( math.noise(timeElapsed * 0.3, 2) * 25, 0, math.noise(5, timeElapsed * 0.3) * 25) local h = Vector3.new(windVec.X, 0, windVec.Z) * 0.9 + ambientWind if h.Magnitude > 260 then h = h.Unit * 260 end local fall = 200 + currentEF * 12 rainVel = rainVel:Lerp(Vector3.new(h.X, -fall, h.Z), 1 - math.exp(-dt * 3)) local rot = CFrame.lookAt(Vector3.zero, rainVel) local active = math.floor(RAIN_DROPS * math.clamp(rainFade * RAIN_INTENSITY, 0, 1)) local radius2 = (RAIN_RADIUS * 1.35) ^ 2 local shelterR2 = SHELTER_RADIUS ^ 2 if active > 0 or not rainIdle then for i = 1, RAIN_DROPS do local d = drops[i] if i > active then d.pos = HIDDEN_POS dropCFs[i] = HIDDEN_CF else local pos = d.pos if pos.Y < -50000 then respawnDrop(d, camPos, true) pos = d.pos else pos = pos + rainVel * (d.v * dt) local dx, dz = pos.X - camPos.X, pos.Z - camPos.Z local hd2 = dx * dx + dz * dz if pos.Y < floorY or hd2 > radius2 or (sheltered and hd2 < shelterR2) then respawnDrop(d, camPos, false) pos = d.pos else d.pos = pos end end dropCFs[i] = CFrame.new(pos) * rot end end workspace:BulkMoveTo(dropParts, dropCFs, Enum.BulkMoveMode.FireCFrameChanged) rainIdle = (active == 0) end splashPlate.CFrame = CFrame.new(camPos.X, floorY + 0.15, camPos.Z) local f = math.clamp(rainFade * RAIN_INTENSITY, 0, 1) splash.Rate = 1800 * QUALITY * f * (sheltered and 0.2 or 1) mist.Rate = 12 * f shelterBlend += ((sheltered and 1 or 0) - shelterBlend) * (1 - math.exp(-dt * 3)) rainSound.Volume = RAIN_VOLUME * rainFade * (1 - 0.6 * shelterBlend) * (0.8 + currentEF * 0.05) rainEQ.HighGain = -22 * shelterBlend if LIGHTNING_ENABLED and supercellProgress > 0.35 and timeElapsed >= nextStrikeTime then local gap = LIGHTNING_MIN_DELAY + math.random() * (LIGHTNING_MAX_DELAY - LIGHTNING_MIN_DELAY) nextStrikeTime = timeElapsed + gap / (1 + currentEF * 0.3) strikeLightning(math.random() < 0.3) if math.random() < 0.25 then task.delay(0.3 + math.random() * 0.7, function() strikeLightning(false) end) end end lightningFlash *= math.exp(-dt * 7) if lightningFlash < 0.002 then lightningFlash = 0 end if lightningFlash > 0 then flashApplied = true Lighting.Brightness = baseBrightness + lightningFlash * 3.5 local k = math.clamp(lightningFlash * 0.7, 0, 1) Lighting.Ambient = baseAmbient:Lerp(Color3.fromRGB(200, 205, 215), k) Lighting.OutdoorAmbient = baseOutdoor:Lerp(Color3.fromRGB(210, 215, 225), k) elseif flashApplied then flashApplied = false Lighting.Brightness = baseBrightness Lighting.Ambient = baseAmbient Lighting.OutdoorAmbient = baseOutdoor end stormGrade.Brightness = -0.03 * rainFade + lightningFlash * 0.16 stormGrade.Saturation = -0.2 * rainFade stormGrade.Contrast = 0.05 * rainFade local fogEnd, atmDensity = baseFogEnd, baseAtmDensity if RAIN_FOG then fogEnd = baseFogEnd - (baseFogEnd - RAIN_FOG_END) * rainFade atmDensity = baseAtmDensity + RAIN_FOG_DENSITY * rainFade end local ib = insideBlend Lighting.FogEnd = fogEnd + (INSIDE.FogEnd - fogEnd) * ib Lighting.FogStart = baseFogStart * (1 - ib) + INSIDE.FogStart * ib Lighting.FogColor = baseFogColor:Lerp(INSIDE.FogColor, ib) if atmosphere then atmosphere.Density = atmDensity + (INSIDE.AtmDensity - atmDensity) * ib atmosphere.Color = baseAtmColor:Lerp(INSIDE.FogColor, ib) end stormGrade.TintColor = Color3.new(1, 1, 1):Lerp(INSIDE.Tint, ib) end) -- [[ CAMERA SHAKE ]] -- RunService:BindToRenderStep("TornadoCameraShake", Enum.RenderPriority.Camera.Value + 1, function() local ib = insideBlend if ib < 0.01 then return end local cam = workspace.CurrentCamera if not cam then return end local k = ib * (0.5 + currentEF * 0.15) local t = os.clock() * 24 local function n(seed) return math.noise(t, seed) * 2 end cam.CFrame = cam.CFrame * CFrame.new(n(1.1) * INSIDE.ShakePos * k, n(2.2) * INSIDE.ShakePos * k, n(3.3) * INSIDE.ShakePos * k) * CFrame.Angles(n(4.4) * INSIDE.ShakeRot * k, n(5.5) * INSIDE.ShakeRot * k, n(6.6) * INSIDE.ShakeRot * k) end) -- [[ PROBES & 3D RADAR SYSTEM ]] -- local function initProbesAndRadar() local PLATE = RADAR.PlateSize local HALF = PLATE / 2 local GRID = RADAR.Grid local CELL = PLATE / GRID local ROOM = RADAR.RoomPos local TOP = ROOM.Y + 2 local SCALE = RADAR.Range / HALF local WALL_H = RADAR.WallHeight local ANG_STEP = 5 local ANG_BUCKETS = 360 / ANG_STEP local RAD90 = math.rad(90) local PALETTE = { Color3.fromRGB(4, 233, 231), Color3.fromRGB(1, 159, 244), Color3.fromRGB(3, 0, 244), Color3.fromRGB(2, 253, 2), Color3.fromRGB(1, 197, 1), Color3.fromRGB(0, 142, 0), Color3.fromRGB(253, 248, 2), Color3.fromRGB(229, 188, 0), Color3.fromRGB(253, 149, 0), Color3.fromRGB(253, 0, 0), Color3.fromRGB(212, 0, 0), Color3.fromRGB(188, 0, 0), Color3.fromRGB(248, 0, 253), Color3.fromRGB(152, 84, 198), Color3.fromRGB(253, 253, 253), } local toolsFolder = Instance.new("Folder") toolsFolder.Name = "TornadoTools" toolsFolder.Parent = workspace local roomFolder = Instance.new("Folder") roomFolder.Name = "RadarRoom" roomFolder.Parent = workspace local function mkPart(parent, size, cf, color, material, solid) local p = Instance.new("Part") p.Size = size p.CFrame = cf p.Color = color p.Material = material or Enum.Material.SmoothPlastic p.Anchored = true p.CanCollide = solid == true p.CanQuery = solid == true p.CanTouch = false p.CastShadow = solid == true p.Parent = parent return p end local function mkCyl(parent, length, diameter, cf, color, material, solid) local p = mkPart(parent, Vector3.new(length, diameter, diameter), cf, color, material, solid) p.Shape = Enum.PartType.Cylinder return p end local function mkLabel(adornee, w, h, offsetY, maxDist) local bb = Instance.new("BillboardGui") bb.Size = UDim2.fromOffset(w, h) bb.StudsOffset = Vector3.new(0, offsetY, 0) bb.AlwaysOnTop = true bb.LightInfluence = 0 bb.MaxDistance = maxDist or 1500 bb.Adornee = adornee bb.Parent = adornee local tl = Instance.new("TextLabel") tl.Size = UDim2.fromScale(1, 1) tl.BackgroundColor3 = Color3.fromRGB(10, 10, 10) tl.BackgroundTransparency = 0.3 tl.TextColor3 = Color3.new(1, 1, 1) tl.Font = Enum.Font.SourceSansBold tl.TextSize = 14 tl.TextWrapped = true tl.Text = "" tl.Parent = bb Instance.new("UICorner", tl) return tl end local rayP = RaycastParams.new() rayP.FilterType = Enum.RaycastFilterType.Exclude local function groundAt(x, z, refY) local list = {funnelFolder, rainFolder, boltFolder, toolsFolder, roomFolder} if Player.Character then list[#list + 1] = Player.Character end rayP.FilterDescendantsInstances = list local r = workspace:Raycast(Vector3.new(x, refY + 80, z), Vector3.new(0, -400, 0), rayP) return r and r.Position or Vector3.new(x, refY - 3, z) end local function spotInFront(dist, sideOff) local char = Player.Character local root = char and char:FindFirstChild("HumanoidRootPart") local base, look if root then base = root.Position look = Vector3.new(root.CFrame.LookVector.X, 0, root.CFrame.LookVector.Z) else local cam = workspace.CurrentCamera base = cam and cam.CFrame.Position or Vector3.zero look = cam and Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z) or Vector3.new(0, 0, -1) end if look.Magnitude < 0.05 then look = Vector3.new(0, 0, -1) end look = look.Unit local right = Vector3.new(-look.Z, 0, look.X) local p = base + look * dist + right * (sideOff or 0) return groundAt(p.X, p.Z, base.Y), look end local probes = {} local probeCounter = 0 local MAX_PROBES = 12 local function buildProbe(pos, yaw) local model = Instance.new("Model") model.Name = "TornadoProbe" model.Parent = toolsFolder local B = CFrame.new(pos) * CFrame.Angles(0, yaw, 0) local ORANGE = Color3.fromRGB(255, 170, 0) local BLACK = Color3.fromRGB(15, 15, 15) local LGREY = Color3.fromRGB(208, 208, 208) local MGREY = Color3.fromRGB(165, 165, 165) local METAL = Enum.Material.Metal for i = 0, 4 do local w = 16 - i * 2.9 mkPart(model, Vector3.new(w, 0.7, w), B * CFrame.new(0, 0.35 + i * 0.7, 0), ORANGE, Enum.Material.SmoothPlastic, true) end mkPart(model, Vector3.new(0.6, 9, 0.6), B * CFrame.new(0, 8, 0), BLACK, METAL, true) mkPart(model, Vector3.new(4.6, 0.5, 0.5), B * CFrame.new(-2.3, 12.2, 0), BLACK, METAL, true) mkPart(model, Vector3.new(0.5, 2.4, 0.5), B * CFrame.new(-4.6, 13.4, 0), BLACK, METAL, true) mkPart(model, Vector3.new(0.4, 0.9, 0.4), B * CFrame.new(0, 12.95, 0), BLACK, METAL, true) mkCyl(model, 2.4, 3.2, B * CFrame.new(-5.5, 15.6, 0), LGREY, METAL, true) mkCyl(model, 2.2, 2.2, B * CFrame.new(-3.3, 15.6, 0), LGREY, METAL, true) mkCyl(model, 1.6, 1.5, B * CFrame.new(-1.5, 15.6, 0), MGREY, METAL, true) mkCyl(model, 1.0, 3.0, B * CFrame.new(-0.7, 15.6, 0), BLACK, METAL, true) mkCyl(model, 0.6, 4.4, B * CFrame.new(0.1, 15.6, 0), BLACK, METAL, true) mkPart(model, Vector3.new(5.1, 0.5, 0.5), B * CFrame.new(2.55, 6.8, 0), BLACK, METAL, true) mkPart(model, Vector3.new(0.5, 2.9, 0.5), B * CFrame.new(5.1, 8.25, 0), BLACK, METAL, true) local widths = {5.2, 5.9, 5.6, 4.8, 3.6} for i, w in ipairs(widths) do local y = 10.25 + (i - 1) * 1.1 mkCyl(model, 1.1, w, B * CFrame.new(5.1, y, 0) * CFrame.Angles(0, 0, RAD90), (i % 2 == 0) and LGREY or MGREY, Enum.Material.SmoothPlastic, true) end local anchor = mkPart(model, Vector3.new(1, 1, 1), B * CFrame.new(0, 20, 0), BLACK, nil, false) anchor.Transparency = 1 local label = mkLabel(anchor, 150, 62, 0, 900) probeCounter += 1 local pr = { id = probeCounter, pos = pos, model = model, label = label, maxWind = 0, minP = 1013, marker = nil, } probes[#probes + 1] = pr return pr end local function clearProbes() for _, pr in ipairs(probes) do if pr.model then pr.model:Destroy() end if pr.marker then pr.marker.part:Destroy() end end probes = {} end local function deployProbe() if RADAR.active then return end if #probes >= MAX_PROBES then local old = table.remove(probes, 1) if old.model then old.model:Destroy() end if old.marker then old.marker.part:Destroy() end end local pos = spotInFront(26, 0) buildProbe(pos, math.random() * math.pi * 2) end local function probeReadings(pos) local rx, rz = pos.X - liveStormPos.X, pos.Z - liveStormPos.Z local d = math.sqrt(rx * rx + rz * rz) local widthScale = 0.4 + 0.6 * descendProgress local Rc = math.max(columnRadius() * widthScale * 0.5, 60) local amb = 6 + 20 * supercellProgress + math.noise(timeElapsed * 0.4, pos.X * 0.01) * 10 local vort, dp = 0, 0 if contact > 0 then local peak = currentWindSpeedMPH * contact vort = (d < Rc) and peak * (d / Rc) or peak * (Rc / d) ^ 1.1 dp = contact * (currentWindSpeedMPH / 318) * 95 * math.exp(-(d / (Rc * 2.5)) ^ 2) end return math.max(amb + vort, 0), 1006 - 4 * supercellProgress - dp, d, Rc end local function windColor(w) if w < 40 then return Color3.fromRGB(120, 255, 150) elseif w < 80 then return Color3.fromRGB(255, 240, 90) elseif w < 130 then return Color3.fromRGB(255, 160, 40) end return Color3.fromRGB(255, 70, 70) end local function updateProbes() for _, pr in ipairs(probes) do local wind, press, dist, Rc = probeReadings(pr.pos) pr.wind, pr.press = wind, press if wind > pr.maxWind then pr.maxWind = wind end if press < pr.minP then pr.minP = press end local extra = "" if contact > 0.5 and dist < Rc then extra = "\n** INTERCEPTED **" end pr.label.Text = string.format("PROBE %d\n%d MPH %d mb\nMAX %d MPH MIN %d mb%s", pr.id, math.floor(wind), math.floor(press), math.floor(pr.maxWind), math.floor(pr.minP), extra) pr.label.TextColor3 = windColor(wind) local lines = (extra ~= "") and 4 or 3 pr.label.Parent.Size = UDim2.fromOffset(170, 20 + lines * 15) end end local stations = {} local stationCounter = 0 local enterRadar local function buildStation(pos) stationCounter += 1 local name = "RADAR " .. stationCounter local model = Instance.new("Model") model.Name = "RadarStation" model.Parent = toolsFolder local WHITE = Color3.fromRGB(235, 238, 242) local GREY = Color3.fromRGB(120, 125, 132) local CONC = Color3.fromRGB(150, 150, 150) local B = CFrame.new(pos) local slab = mkPart(model, Vector3.new(16, 1, 16), B * CFrame.new(0, 0.5, 0), CONC, Enum.Material.Concrete, true) mkCyl(model, 30, 4, B * CFrame.new(0, 16, 0) * CFrame.Angles(0, 0, RAD90), WHITE, Enum.Material.SmoothPlastic, true) mkPart(model, Vector3.new(5, 3, 5), B * CFrame.new(0, 32.5, 0), GREY, Enum.Material.Metal, true) mkPart(model, Vector3.new(1.2, 5, 1.2), B * CFrame.new(0, 36.5, 0), GREY, Enum.Material.Metal, false) local disc = mkCyl(model, 0.8, 14, B * CFrame.new(0, 40.5, 0), WHITE, Enum.Material.SmoothPlastic, false) local horn = mkPart(model, Vector3.new(5, 0.8, 0.8), B * CFrame.new(3.4, 40.5, 0), GREY, Enum.Material.Metal, false) local tip = mkPart(model, Vector3.new(1, 2, 2), B * CFrame.new(6.2, 40.5, 0), GREY, Enum.Material.Metal, false) local beacon = mkPart(model, Vector3.new(1.4, 1.4, 1.4), B * CFrame.new(0, 34.7, 0), Color3.fromRGB(255, 40, 40), Enum.Material.Neon, false) local lab = mkLabel(slab, 110, 26, 14, 700) lab.Text = name local prompt = Instance.new("ProximityPrompt") prompt.ActionText = "OPEN RADAR" prompt.ObjectText = name prompt.HoldDuration = 0 prompt.MaxActivationDistance = 18 prompt.RequiresLineOfSight = false prompt.Parent = slab local st = { name = name, pos = pos, model = model, disc = disc, horn = horn, tip = tip, beacon = beacon, ang = math.random() * 6, } prompt.Triggered:Connect(function() if enterRadar then enterRadar(st) end end) stations[#stations + 1] = st return st end local function deployRadar() if RADAR.active then return nil end local pos = spotInFront(40, 0) return buildStation(pos) end local function nearestStation() local ref = RADAR.active and RADAR.realCamPos or getFocusPosition() local best, bd for _, st in ipairs(stations) do local d = (st.pos - ref).Magnitude if not bd or d < bd then best, bd = st, d end end return best end local K = SUPERCELL_SCALE local fwdV = SUPERCELL_HEADING local sideV = Vector3.new(-fwdV.Z, 0, fwdV.X) local tU, tV = tOffF / K, tOffS / K local hook = {} for i = 0, 14 do local t = i / 14 local th = t * 4.6 local r = 950 - 520 * t hook[#hook + 1] = {math.cos(th) * r, math.sin(th) * r} end local function stormDBZ(wx, wz) local t = timeElapsed local rx, rz = wx - liveStormPos.X, wz - liveStormPos.Z local du = (rx * fwdV.X + rz * fwdV.Z) / K local dv = (rx * sideV.X + rz * sideV.Z) / K local u, v = du + tU, dv + tV local g = math.clamp(supercellProgress, 0, 1) local n1 = math.noise(wx * 0.0006, wz * 0.0006, t * 0.04) local n2 = math.noise(wx * 0.0025 + 40, wz * 0.0025 + 40, t * 0.1) local d1 = math.sqrt(((u - 1700) / 1500) ^ 2 + (v / 1300) ^ 2) local dbz = 68 - 40 * d1 ^ 1.3 + n2 * 10 local d2 = math.sqrt(((u - 3600) / 3300) ^ 2 + ((v - 500) / 1100) ^ 2) dbz = math.max(dbz, 46 - 34 * d2 ^ 1.2 + n2 * 9) local d3 = math.sqrt(((u + 200) / 2600) ^ 2 + ((v + 900) / 1300) ^ 2) dbz = math.max(dbz, 40 - 36 * d3 ^ 1.2 + n2 * 8) local dc = math.sqrt((u - 1500) ^ 2 + v ^ 2) / 9000 dbz = math.max(dbz, 24 - 28 * dc + n1 * 28) dbz = dbz - (1 - g ^ 0.7) * 60 local hookAmt = math.clamp((supercellProgress - 0.6) / 0.4, 0, 1) if hookAmt > 0 then local dh = math.huge for _, h in ipairs(hook) do local a, b = du - h[1], dv - h[2] local dd = a * a + b * b if dd < dh then dh = dd end end dh = math.sqrt(dh) dbz = math.max(dbz, 60 * hookAmt * math.exp(-(dh / 230) ^ 2) - 4 + n2 * 4) end if contact > 0.2 then local dtor = math.sqrt(du * du + dv * dv) * K dbz = math.max(dbz, 78 * contact * math.exp(-(dtor / 1000) ^ 2)) end return dbz end local function dbzToIdx(d) if d < 5 then return 0 end return math.min(15, math.floor((d - 5) / 5) + 1) end local room = {ready = false, cells = {}, byAngle = {}} local curStation = nil local sweepAng = 0 local sweepLine, tvs, tvsLabel, stationMarkLabel local function setCell(c, idx) if idx == c.bucket then return end c.bucket = idx local p = c.p if idx == 0 then p.Transparency = 1 return end local h = 0.25 + idx * 0.4 p.Color = PALETTE[idx] p.Size = Vector3.new(CELL * 0.96, h, CELL * 0.96) p.CFrame = CFrame.new(ROOM.X + c.lx, TOP + h / 2, ROOM.Z + c.lz) p.Transparency = (idx <= 3) and 0.4 or 0 end local function refreshCell(c, st) local wx = st.pos.X + c.lx * SCALE local wz = st.pos.Z + c.lz * SCALE setCell(c, dbzToIdx(stormDBZ(wx, wz))) end local function fullRefresh(st) for _, c in ipairs(room.cells) do refreshCell(c, st) end end local function refreshBucket(b, st) local list = room.byAngle[b] if not list then return end for _, ci in ipairs(list) do refreshCell(room.cells[ci], st) end end local function buildOverlay(plate) local sg = Instance.new("SurfaceGui") sg.Face = Enum.NormalId.Top sg.CanvasSize = Vector2.new(720, 720) sg.LightInfluence = 0 sg.Parent = plate local function line(x1, y1, x2, y2, color, thick, transp) local f = Instance.new("Frame") local dx, dy = x2 - x1, y2 - y1 f.AnchorPoint = Vector2.new(0.5, 0.5) f.Position = UDim2.fromOffset((x1 + x2) / 2, (y1 + y2) / 2) f.Size = UDim2.fromOffset(math.sqrt(dx * dx + dy * dy), thick) f.Rotation = math.deg(math.atan2(dy, dx)) f.BackgroundColor3 = color f.BackgroundTransparency = transp or 0 f.BorderSizePixel = 0 f.Parent = sg end for i = 1, 3 do local ring = Instance.new("Frame") local s = 720 * i / 3 ring.AnchorPoint = Vector2.new(0.5, 0.5) ring.Position = UDim2.fromOffset(360, 360) ring.Size = UDim2.fromOffset(s, s) ring.BackgroundTransparency = 1 ring.Parent = sg local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0.5, 0) corner.Parent = ring local stroke = Instance.new("UIStroke") stroke.Color = Color3.fromRGB(235, 235, 235) stroke.Thickness = 2 stroke.Transparency = 0.35 stroke.Parent = ring local tl = Instance.new("TextLabel") tl.AnchorPoint = Vector2.new(0.5, 0) tl.Position = UDim2.fromOffset(360, 360 - s / 2 + 2) tl.Size = UDim2.fromOffset(120, 22) tl.BackgroundTransparency = 1 tl.TextColor3 = Color3.fromRGB(235, 235, 235) tl.TextTransparency = 0.2 tl.Font = Enum.Font.SourceSansBold tl.TextSize = 18 tl.Text = string.format("%dK", math.floor(RADAR.Range * i / 3 / 1000)) tl.Parent = sg end line(360, 0, 360, 720, Color3.fromRGB(235, 235, 235), 1.5, 0.55) line(0, 360, 720, 360, Color3.fromRGB(235, 235, 235), 1.5, 0.55) local rx, ry = 0, 120 + math.random() * 480 for _ = 1, 9 do local nx = rx + 90 + math.random() * 30 local ny = math.clamp(ry + (math.random() - 0.5) * 140, 20, 700) line(rx, ry, nx, ny, Color3.fromRGB(0, 230, 255), 3, 0.1) rx, ry = nx, ny end for _ = 1, 4 do local x1, y1 = math.random() * 720, math.random() * 720 local ang = math.random() * math.pi for _ = 1, 3 do local len = 90 + math.random() * 120 local x2, y2 = x1 + math.cos(ang) * len, y1 + math.sin(ang) * len line(x1, y1, x2, y2, Color3.fromRGB(245, 245, 245), 2, 0.1) x1, y1 = x2, y2 ang += (math.random() - 0.5) * 1.4 end end end local function buildRoom() local plate = mkPart(roomFolder, Vector3.new(PLATE, 4, PLATE), CFrame.new(ROOM), Color3.fromRGB(62, 135, 55), Enum.Material.Grass, false) plate.Name = "RadarPlate" local BLACK = Color3.fromRGB(12, 12, 12) local wallY = ROOM.Y - 2 + (WALL_H + 4) / 2 mkPart(roomFolder, Vector3.new(PLATE + 16, WALL_H + 4, 8), CFrame.new(ROOM.X, wallY, ROOM.Z - HALF - 4), BLACK) mkPart(roomFolder, Vector3.new(PLATE + 16, WALL_H + 4, 8), CFrame.new(ROOM.X, wallY, ROOM.Z + HALF + 4), BLACK) mkPart(roomFolder, Vector3.new(8, WALL_H + 4, PLATE + 16), CFrame.new(ROOM.X - HALF - 4, wallY, ROOM.Z), BLACK) mkPart(roomFolder, Vector3.new(8, WALL_H + 4, PLATE + 16), CFrame.new(ROOM.X + HALF + 4, wallY, ROOM.Z), BLACK) buildOverlay(plate) sweepLine = mkPart(roomFolder, Vector3.new(0.5, 0.5, HALF), CFrame.new(ROOM.X, TOP + 8, ROOM.Z), Color3.fromRGB(255, 255, 255), Enum.Material.Neon, false) sweepLine.Transparency = 0.25 local mk = mkPart(roomFolder, Vector3.new(3, 6, 3), CFrame.new(ROOM.X, TOP + 3, ROOM.Z), Color3.fromRGB(240, 240, 240), Enum.Material.SmoothPlastic, false) stationMarkLabel = mkLabel(mk, 90, 22, 5, 2500) stationMarkLabel.Text = "RADAR" tvs = mkPart(roomFolder, Vector3.new(1.6, 10, 1.6), CFrame.new(ROOM.X, TOP + 5, ROOM.Z), Color3.fromRGB(248, 0, 253), Enum.Material.Neon, false) tvs.Transparency = 1 tvsLabel = mkLabel(tvs, 150, 24, 7, 2500) tvsLabel.Text = "" local count = 0 for iz = 1, GRID do for ix = 1, GRID do local lx = (ix - 0.5) * CELL - HALF local lz = (iz - 0.5) * CELL - HALF if lx * lx + lz * lz <= HALF * HALF then local p = Instance.new("Part") p.Name = "Echo" p.Size = Vector3.new(CELL * 0.96, 0.2, CELL * 0.96) p.CFrame = CFrame.new(ROOM.X + lx, TOP + 0.1, ROOM.Z + lz) p.Material = Enum.Material.SmoothPlastic p.Anchored = true p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = false, false, false, false p.Transparency = 1 p.Parent = roomFolder room.cells[#room.cells + 1] = {p = p, lx = lx, lz = lz, bucket = 0} local a = math.deg(math.atan2(lz, lx)) % 360 local b = math.floor(a / ANG_STEP) + 1 room.byAngle[b] = room.byAngle[b] or {} table.insert(room.byAngle[b], #room.cells) count += 1 if count % 120 == 0 then task.wait() end end end end room.ready = true end local ui = Instance.new("ScreenGui") ui.Name = "RadarUI" ui.ResetOnSpawn = false ui.DisplayOrder = 10 ui.Enabled = false ui.Parent = Player.PlayerGui local held = {} local function mkBtn(text, anchor, pos, size, color, name) local b = Instance.new("TextButton") b.AnchorPoint = anchor b.Position = pos b.Size = size b.BackgroundColor3 = color b.BackgroundTransparency = 0.15 b.TextColor3 = Color3.new(1, 1, 1) b.Font = Enum.Font.SourceSansBold b.TextSize = 18 b.Text = text b.AutoButtonColor = true b.Parent = ui Instance.new("UICorner", b) if name then b.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then held[name] = true end end) b.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then held[name] = false end end) end return b end local infoLabel = Instance.new("TextLabel") infoLabel.AnchorPoint = Vector2.new(0.5, 0) infoLabel.Position = UDim2.new(0.5, 0, 0, 6) infoLabel.Size = UDim2.new(1, -16, 0, 34) infoLabel.BackgroundColor3 = Color3.fromRGB(10, 10, 10) infoLabel.BackgroundTransparency = 0.25 infoLabel.TextColor3 = Color3.fromRGB(0, 255, 150) infoLabel.Font = Enum.Font.SourceSansBold infoLabel.TextSize = 14 infoLabel.TextWrapped = true infoLabel.Text = "RADAR" infoLabel.Parent = ui Instance.new("UICorner", infoLabel) local legend = Instance.new("Frame") legend.AnchorPoint = Vector2.new(0.5, 0) legend.Position = UDim2.new(0.5, 0, 0, 46) legend.Size = UDim2.fromOffset(255, 14) legend.BackgroundTransparency = 1 legend.Parent = ui for i = 1, 15 do local f = Instance.new("Frame") f.Position = UDim2.new((i - 1) / 15, 0, 0, 0) f.Size = UDim2.new(1 / 15, 0, 1, 0) f.BackgroundColor3 = PALETTE[i] f.BorderSizePixel = 0 f.Parent = legend end local legendText = Instance.new("TextLabel") legendText.AnchorPoint = Vector2.new(0.5, 0) legendText.Position = UDim2.new(0.5, 0, 0, 61) legendText.Size = UDim2.fromOffset(255, 14) legendText.BackgroundTransparency = 1 legendText.TextColor3 = Color3.new(1, 1, 1) legendText.TextStrokeTransparency = 0.4 legendText.Font = Enum.Font.SourceSansBold legendText.TextSize = 12 legendText.Text = "5 dBZ 75" legendText.Parent = ui local BL, BR = Vector2.new(0, 1), Vector2.new(1, 1) local SQ = UDim2.fromOffset(44, 44) local GREYB, BLUEB = Color3.fromRGB(40, 40, 40), Color3.fromRGB(30, 80, 150) mkBtn("▲", BL, UDim2.new(0, 52, 1, -96), SQ, GREYB, "up") mkBtn("◀", BL, UDim2.new(0, 6, 1, -52), SQ, GREYB, "left") mkBtn("▶", BL, UDim2.new(0, 98, 1, -52), SQ, GREYB, "right") mkBtn("▼", BL, UDim2.new(0, 52, 1, -8), SQ, GREYB, "down") mkBtn("+", BR, UDim2.new(1, -8, 1, -96), SQ, BLUEB, "zin") mkBtn("-", BR, UDim2.new(1, -8, 1, -52), SQ, BLUEB, "zout") local topBtn = mkBtn("TOP", BR, UDim2.new(1, -8, 1, -140), SQ, BLUEB, nil) local exitBtn = mkBtn("EXIT RADAR", Vector2.new(0.5, 1), UDim2.new(0.5, 0, 1, -8), UDim2.fromOffset(120, 38), Color3.fromRGB(190, 40, 40), nil) topBtn.TextSize = 13 exitBtn.TextSize = 14 local cam3 = {yaw = 0, pitch = math.rad(52), dist = 330, focus = Vector3.new(ROOM.X, TOP + 1, ROOM.Z)} local saved = {} local touches = {} local mouseDown = false local function setControls(enabled) pcall(function() local ps = Player:FindFirstChild("PlayerScripts") local pm = ps and ps:FindFirstChild("PlayerModule") if pm then local controls = require(pm):GetControls() if enabled then controls:Enable() else controls:Disable() end end end) end local function rotateCam(dx, dy) cam3.yaw -= dx * 0.006 cam3.pitch = math.clamp(cam3.pitch + dy * 0.005, 0.12, 1.5) end local function zoomCam(mul) cam3.dist = math.clamp(cam3.dist * mul, 30, 900) end local function stepCamera(dt) local cam = workspace.CurrentCamera if not cam then return end dt = math.min(dt, 0.1) local f = Vector3.new(-math.sin(cam3.yaw), 0, -math.cos(cam3.yaw)) local r = Vector3.new(math.cos(cam3.yaw), 0, -math.sin(cam3.yaw)) local mv = Vector3.zero if held.up or UserInputService:IsKeyDown(Enum.KeyCode.W) then mv += f end if held.down or UserInputService:IsKeyDown(Enum.KeyCode.S) then mv -= f end if held.right or UserInputService:IsKeyDown(Enum.KeyCode.D) then mv += r end if held.left or UserInputService:IsKeyDown(Enum.KeyCode.A) then mv -= r end local fast = UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) and 2 or 1 if mv.Magnitude > 0 then cam3.focus += mv.Unit * cam3.dist * 0.7 * fast * dt end if UserInputService:IsKeyDown(Enum.KeyCode.E) then cam3.focus += Vector3.new(0, 70 * dt, 0) end if UserInputService:IsKeyDown(Enum.KeyCode.Q) then cam3.focus -= Vector3.new(0, 70 * dt, 0) end if held.zin then zoomCam(1 - 1.2 * dt) end if held.zout then zoomCam(1 + 1.2 * dt) end cam3.focus = Vector3.new( math.clamp(cam3.focus.X, ROOM.X - HALF, ROOM.X + HALF), math.clamp(cam3.focus.Y, TOP, TOP + WALL_H * 1.5), math.clamp(cam3.focus.Z, ROOM.Z - HALF, ROOM.Z + HALF) ) local cp = math.cos(cam3.pitch) local pos = cam3.focus + Vector3.new(math.sin(cam3.yaw) * cp, math.sin(cam3.pitch), math.cos(cam3.yaw) * cp) * cam3.dist cam.CFrame = CFrame.lookAt(pos, cam3.focus) end local function exitRadar() if not RADAR.active then return end RADAR.active = false pcall(function() RunService:UnbindFromRenderStep("RadarCamera") end) local cam = workspace.CurrentCamera if cam then cam.CameraType = saved.camType or Enum.CameraType.Custom if saved.camCF then cam.CFrame = saved.camCF end end setControls(true) ui.Enabled = false if saved.gui then saved.gui.Enabled = true end for k in pairs(held) do held[k] = false end touches = {} mouseDown = false curStation = nil end function enterRadar(st) if RADAR.active or not st then return end if not room.ready then warn("[radar] the radar room is still building, try again in a moment") return end local cam = workspace.CurrentCamera if not cam then return end RADAR.realCamPos = cam.CFrame.Position saved.camCF, saved.camType = cam.CFrame, cam.CameraType RADAR.active = true curStation = st cam.CameraType = Enum.CameraType.Scriptable setControls(false) saved.gui = Player.PlayerGui:FindFirstChild("TornadoControls") if saved.gui then saved.gui.Enabled = false end ui.Enabled = true cam3.yaw, cam3.pitch, cam3.dist = 0, math.rad(52), 330 cam3.focus = Vector3.new(ROOM.X, TOP + 1, ROOM.Z) stationMarkLabel.Text = st.name sweepAng = 0 fullRefresh(st) RunService:BindToRenderStep("RadarCamera", Enum.RenderPriority.Camera.Value + 2, stepCamera) end exitBtn.MouseButton1Click:Connect(exitRadar) topBtn.MouseButton1Click:Connect(function() cam3.pitch = 1.5 cam3.yaw = 0 cam3.dist = 380 cam3.focus = Vector3.new(ROOM.X, TOP + 1, ROOM.Z) end) UserInputService.InputBegan:Connect(function(input, gp) if not RADAR.active or gp then return end local t = input.UserInputType if t == Enum.UserInputType.Touch then touches[input] = Vector2.new(input.Position.X, input.Position.Y) elseif t == Enum.UserInputType.MouseButton1 or t == Enum.UserInputType.MouseButton2 then mouseDown = true end end) UserInputService.InputChanged:Connect(function(input, gp) if not RADAR.active then return end local t = input.UserInputType if t == Enum.UserInputType.Touch then local last = touches[input] if not last then return end local cur = Vector2.new(input.Position.X, input.Position.Y) local n = 0 local other for tin, p in pairs(touches) do n += 1 if tin ~= input then other = p end end if n == 1 then rotateCam(cur.X - last.X, cur.Y - last.Y) elseif other then local prevD = (last - other).Magnitude local curD = (cur - other).Magnitude if prevD > 8 and curD > 8 then zoomCam(prevD / curD) end end touches[input] = cur elseif t == Enum.UserInputType.MouseMovement then if mouseDown then rotateCam(input.Delta.X, input.Delta.Y) end elseif t == Enum.UserInputType.MouseWheel then zoomCam(1 - input.Position.Z * 0.12) end end) UserInputService.InputEnded:Connect(function(input) local t = input.UserInputType if t == Enum.UserInputType.Touch then touches[input] = nil for k in pairs(held) do held[k] = false end elseif t == Enum.UserInputType.MouseButton1 or t == Enum.UserInputType.MouseButton2 then mouseDown = false for k in pairs(held) do held[k] = false end end end) local tick4 = 0 local function toRoom(st, wx, wz) local lx = (wx - st.pos.X) / SCALE local lz = (wz - st.pos.Z) / SCALE if lx * lx + lz * lz > HALF * HALF then return nil end return Vector3.new(ROOM.X + lx, TOP, ROOM.Z + lz) end local function updateRadarMarkers(st) local tpos = toRoom(st, liveStormPos.X, liveStormPos.Z) if tpos and descendProgress > 0.02 then local h = 6 + descendProgress * 6 + contact * currentEF * 3 tvs.Size = Vector3.new(1.6, h, 1.6) tvs.CFrame = CFrame.new(tpos + Vector3.new(0, h / 2, 0)) tvs.Transparency = 0 if contact >= 0.6 then tvs.Color = Color3.fromRGB(248, 0, 253) tvsLabel.Text = string.format("TVS %s %d MPH", EF_SETTINGS[currentEF].Name, math.floor(currentWindSpeedMPH)) else tvs.Color = Color3.fromRGB(255, 160, 0) tvsLabel.Text = string.format("FUNNEL ALOFT %d%%", math.floor(descendProgress * 100)) end else tvs.Transparency = 1 tvsLabel.Text = "" end for _, pr in ipairs(probes) do local mpos = toRoom(st, pr.pos.X, pr.pos.Z) if not pr.marker then local part = mkPart(roomFolder, Vector3.new(2.2, 2.2, 2.2), CFrame.new(ROOM), Color3.fromRGB(255, 170, 0), Enum.Material.SmoothPlastic, false) part.Transparency = 1 pr.marker = {part = part, label = mkLabel(part, 110, 36, 3, 2500)} end if mpos then pr.marker.part.CFrame = CFrame.new(mpos + Vector3.new(0, 1.4, 0)) pr.marker.part.Transparency = 0 pr.marker.label.Text = string.format("PROBE %d\n%d MPH", pr.id, math.floor(pr.wind or 0)) pr.marker.label.TextColor3 = windColor(pr.wind or 0) pr.marker.label.Parent.Enabled = true else pr.marker.part.Transparency = 1 pr.marker.label.Parent.Enabled = false end end end local function infoText(st) local dx, dz = liveStormPos.X - st.pos.X, liveStormPos.Z - st.pos.Z local dist = math.sqrt(dx * dx + dz * dz) / 1000 if contact >= 0.6 then return string.format("%s | TORNADO ON GROUND | %s %d MPH | %.1fK studs away", st.name, EF_SETTINGS[currentEF].Name, math.floor(currentWindSpeedMPH), dist) elseif descendProgress > 0.02 then return string.format("%s | FUNNEL DESCENDING %d%% | %.1fK studs away", st.name, math.floor(descendProgress * 100), dist) elseif phase == "waiting" then return string.format("%s | SUPERCELL READY - WATCH THE HOOK | %.1fK studs away", st.name, dist) end return string.format("%s | SUPERCELL FORMING %d%%", st.name, math.floor(supercellProgress * 100)) end RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) local clk = os.clock() for _, st in ipairs(stations) do st.ang += dt * 1.7 local R = CFrame.new(st.pos) * CFrame.Angles(0, st.ang, 0) st.disc.CFrame = R * CFrame.new(0, 40.5, 0) st.horn.CFrame = R * CFrame.new(3.4, 40.5, 0) st.tip.CFrame = R * CFrame.new(6.2, 40.5, 0) st.beacon.Transparency = (clk % 1.4 < 0.2) and 0 or 0.85 end tick4 += dt local doTick = tick4 >= 0.25 if doTick then tick4 = 0 updateProbes() end if not RADAR.active or not curStation or not room.ready then return end local st = curStation local newAng = sweepAng + RADAR.ScanSpeed * dt local b0 = math.floor(sweepAng / ANG_STEP) local b1 = math.floor(newAng / ANG_STEP) for b = b0 + 1, b1 do refreshBucket((b % ANG_BUCKETS) + 1, st) end sweepAng = newAng % 360 local ar = math.rad(sweepAng) local dir = Vector3.new(math.cos(ar), 0, math.sin(ar)) local c0 = Vector3.new(ROOM.X, TOP + 8, ROOM.Z) sweepLine.CFrame = CFrame.lookAt(c0 + dir * (HALF / 2), c0 + dir * HALF) if doTick then updateRadarMarkers(st) infoLabel.Text = infoText(st) end end) TOOLS.deployProbe = deployProbe TOOLS.clearProbes = clearProbes TOOLS.deployRadar = deployRadar TOOLS.openRadar = function() if RADAR.active then return end local st = nearestStation() or deployRadar() if st then enterRadar(st) end end task.spawn(buildRoom) task.spawn(function() local char = Player.Character or Player.CharacterAdded:Wait() char:WaitForChild("HumanoidRootPart", 10) task.wait(1) local rp = spotInFront(45, 12) buildStation(rp) local pp = spotInFront(30, -14) buildProbe(pp, math.random() * math.pi * 2) end) end task.spawn(initProbesAndRadar) -- [[ SIRENS SYSTEM ]] -- local function initSirens() local folder = Instance.new("Folder") folder.Name = "TornadoSirens" folder.Parent = workspace local RAD90 = math.rad(90) local sirens = {} local playing = false local started = false local autoDone = false local function smooth(x) x = math.clamp(x, 0, 1) return x * x * (3 - 2 * x) end local function mk(size, cf, color, material, solid, isCyl) local p = Instance.new("Part") p.Size = size p.CFrame = cf p.Color = color p.Material = material or Enum.Material.SmoothPlastic p.Anchored = true p.CanCollide = solid == true p.CanQuery = solid == true p.CanTouch = false p.CastShadow = solid == true if isCyl then p.Shape = Enum.PartType.Cylinder end p.Parent = folder return p end local rayP = RaycastParams.new() rayP.FilterType = Enum.RaycastFilterType.Exclude local function groundAt(x, z) local list = {funnelFolder, rainFolder, boltFolder, folder} if Player.Character then list[#list + 1] = Player.Character end rayP.FilterDescendantsInstances = list local r = workspace:Raycast(Vector3.new(x, groundY + 400, z), Vector3.new(0, -1200, 0), rayP) return r and r.Position or Vector3.new(x, groundY, z) end local function finish(s) if not s.active then return end s.active = false s.snd.Volume = 0 s.rv.WetLevel = -80 s.rv.DryLevel = 0 end local function buildSiren(pos) local B = CFrame.new(pos) local GREY = Color3.fromRGB(150, 152, 158) local WHITE = Color3.fromRGB(235, 235, 235) local ORANGE = Color3.fromRGB(255, 140, 0) mk(Vector3.new(6, 1, 6), B * CFrame.new(0, 0.5, 0), Color3.fromRGB(140, 140, 140), Enum.Material.Concrete, true) mk(Vector3.new(38, 2, 2), B * CFrame.new(0, 20, 0) * CFrame.Angles(0, 0, RAD90), GREY, Enum.Material.Metal, true, true) local hub = mk(Vector3.new(2.4, 3.4, 3.4), B * CFrame.new(0, 40, 0) * CFrame.Angles(0, 0, RAD90), GREY, Enum.Material.Metal, false, true) local beacon = mk(Vector3.new(1.3, 1.3, 1.3), B * CFrame.new(0, 42.4, 0), Color3.fromRGB(255, 40, 40), Enum.Material.Neon, false) local horns = {} for i = 0, 3 do local off = i * math.pi / 2 local horn = mk(Vector3.new(5, 3, 3), B * CFrame.Angles(0, off, 0) * CFrame.new(3.6, 40, 0), WHITE, Enum.Material.SmoothPlastic, false, true) local bell = mk(Vector3.new(1.2, 4.6, 4.6), B * CFrame.Angles(0, off, 0) * CFrame.new(6.3, 40, 0), ORANGE, Enum.Material.SmoothPlastic, false, true) horns[#horns + 1] = {horn = horn, bell = bell, off = off} end local snd = Instance.new("Sound") snd.Name = "SirenSound" snd.SoundId = SIREN.SoundId snd.Looped = false snd.Volume = 0 snd.RollOffMinDistance = SIREN.RollOffMin snd.RollOffMaxDistance = SIREN.RollOffMax local rv = Instance.new("ReverbSoundEffect") rv.DecayTime = SIREN.ReverbDecay rv.Density = 1 rv.Diffusion = 1 rv.DryLevel = 0 rv.WetLevel = -80 rv.Parent = snd snd.Parent = hub local s = {pos = pos, hub = hub, beacon = beacon, horns = horns, snd = snd, rv = rv, ang = math.random() * 6, active = false, t0 = 0} snd.Ended:Connect(function() finish(s) end) sirens[#sirens + 1] = s task.spawn(function() pcall(function() game:GetService("ContentProvider"):PreloadAsync({snd}) end) end) return s end local function startSiren() if playing then return end playing = true started = false task.spawn(function() local t0 = os.clock() for _, s in ipairs(sirens) do while not s.snd.IsLoaded and os.clock() - t0 < 10 do task.wait(0.1) end end if #sirens == 0 or not sirens[1].snd.IsLoaded then warn("[siren] the siren audio did not load") playing = false return end for _, s in ipairs(sirens) do s.snd.Volume = 0 s.snd.TimePosition = 0 s.rv.WetLevel = -80 s.rv.DryLevel = 0 s.active = true s.t0 = os.clock() s.snd:Play() end started = true end) end RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) if SIREN.AutoOnDescend and not autoDone and (phase == "descending" or phase == "active") then autoDone = true startSiren() end local clk = os.clock() local anyActive = false for _, s in ipairs(sirens) do local env = 0 if s.active then local snd = s.snd if not snd.Playing and clk - s.t0 > 1.5 then finish(s) elseif snd.TimeLength > 0 then local len, pos = snd.TimeLength, snd.TimePosition local fi = math.min(SIREN.FadeIn, len * 0.4) local fo = math.min(SIREN.FadeOut, len * 0.4) local fadeInK = smooth(pos / fi) local fadeOutK = smooth((len - pos) / fo) env = fadeInK * fadeOutK snd.Volume = SIREN.Volume * env local f = smooth(1 - (len - pos) / fo) s.rv.WetLevel = -60 + 63 * f s.rv.DryLevel = -10 * f anyActive = true end end if env > 0.001 then s.ang += dt * 3.2 * env local R = CFrame.new(s.pos) * CFrame.Angles(0, s.ang, 0) for _, h in ipairs(s.horns) do local rot = R * CFrame.Angles(0, h.off, 0) h.horn.CFrame = rot * CFrame.new(3.6, 40, 0) h.bell.CFrame = rot * CFrame.new(6.3, 40, 0) end end s.beacon.Transparency = (s.active and clk % 0.6 < 0.3) and 0 or 0.85 end if playing and started and not anyActive then playing = false end end) TOOLS.siren = startSiren task.spawn(function() task.wait(1) local center = getFocusPosition() for i = 1, SIREN.Count do local a = (i / SIREN.Count) * math.pi * 2 + (math.random() - 0.5) * 0.6 local d = SIREN.MinDist + math.random() * (SIREN.MaxDist - SIREN.MinDist) buildSiren(groundAt(center.X + math.cos(a) * d, center.Z + math.sin(a) * d)) end end) end task.spawn(initSirens) -- ==================================================================== -- [[ DISASTER PACK: house-part suction, walking NPCs, crashable cars ]] -- No other edits needed. It builds everything itself. -- ==================================================================== task.spawn(function() -- Define necessary services to fix the nil index error local RunService = game:GetService("RunService") local Debris = game:GetService("Debris") local Players = game:GetService("Players") local Player = Players.LocalPlayer local CAR_ID = "rbxassetid://15030483102" local PACK = { -- house parts (named 1-5) after the tornado breaks them loose WindScale = 1.0, -- mph -> studs/sec target speed of the wind field DragBase = 0.5, -- how hard wind grabs parts (thin parts get grabbed harder) LiftFrac = {[0] = 0.0, [1] = 0.15, [2] = 0.35, [3] = 0.6, [4] = 0.85, [5] = 1.05}, MaxParts = 600, ReleaseDist = 5, -- x column radius, parts farther than this are let go StepEvery = 0.06, TossEvery = {[2] = {3, 7}, [3] = {2, 5}, [4] = {1.2, 3.5}, [5] = {0.8, 2.5}}, TossAccel = {[2] = 90, [3] = 170, [4] = 260, [5] = 380}, TossTime = 0.45, EjectAfter = {[2] = {16, 32}, [3] = {11, 22}, [4] = {8, 16}, [5] = {6, 12}}, EjectAccel = 520, EjectTime = 0.8, Cooldown = 12, SpinCap = 12, -- cars Cars = 5, CarMin = 70, CarMax = 260, CrashDV = 45, -- sudden speed change (studs/s in one frame) that counts as a crash -- npcs Npcs = 10, NpcMin = 30, NpcMax = 220, HitSpeed = 45, -- relative speed that knocks an NPC down KillSpeed = 95, -- relative speed that kills an NPC DeathSpeed = 100, -- landing speed that kills a thrown NPC } local packFolder = Instance.new("Folder") packFolder.Name = "DisasterPack" packFolder.Parent = workspace local groundRay = RaycastParams.new() groundRay.FilterType = Enum.RaycastFilterType.Exclude local function groundAt(x, z) local list = {funnelFolder, packFolder} if Player.Character then list[#list + 1] = Player.Character end groundRay.FilterDescendantsInstances = list local top = getFocusPosition().Y + 400 local r = workspace:Raycast(Vector3.new(x, top, z), Vector3.new(0, -2000, 0), groundRay) return r and r.Position or Vector3.new(x, groundY, z) end -- ================================================================ -- WIND FIELD (studs/sec): spin + inflow + updraft, scaled by live mph -- ================================================================ local function fieldCore() return math.max(columnRadius() * (0.4 + 0.6 * descendProgress) * 0.8, 60) end local function fieldAt(pos, center, peakMph, core) local rx, rz = pos.X - center.X, pos.Z - center.Z local dist = math.max(math.sqrt(rx * rx + rz * rz), 1) local rdx, rdz = rx / dist, rz / dist local vt = (dist < core) and (dist / core) or (core / dist) ^ 0.75 local h01 = math.clamp((pos.Y - center.Y) / sm.Height, 0, 1) local upK = math.clamp(1 - dist / (core * 1.7), 0, 1) ^ 0.7 local v = Vector3.new(-rdz, 0, rdx) * (vt * peakMph) + Vector3.new(-rdx, 0, -rdz) * (vt * peakMph * 0.45) + Vector3.new(0, upK * peakMph * 0.7 * (1 - 0.5 * h01), 0) return v * PACK.WindScale end local function centerAt(pos) local h01 = math.clamp((pos.Y - liveStormPos.Y) / sm.Height, 0, 1) local bx, bz = bendAt(h01) return Vector3.new(liveStormPos.X + bx, liveStormPos.Y, liveStormPos.Z + bz) end -- ================================================================ -- EF HOUSE PARTS: VectorForce drag toward the wind, lift, tosses, ejection -- ================================================================ local efParts, efCount = {}, 0 local function dropEF(p, st) efParts[p] = nil efCount -= 1 if st.vf then st.vf:Destroy() end if st.att then st.att:Destroy() end end local function adopt(p) if efCount >= PACK.MaxParts or efParts[p] then return end p.Anchored = false for _, j in ipairs(p:GetJoints()) do pcall(function() j:Destroy() end) end local att = Instance.new("Attachment") att.Name = "TornadoAtt" att.Parent = p local vf = Instance.new("VectorForce") vf.Name = "TornadoForce" -- same name the main script checks, so it won't add a second force vf.Attachment0 = att vf.RelativeTo = Enum.ActuatorRelativeTo.World vf.ApplyAtCenterOfMass = true vf.Force = Vector3.zero vf.Parent = p local s = p.Size local thick = math.max(math.min(s.X, s.Y, s.Z), 0.4) local k = math.clamp(PACK.DragBase * 4 / thick, 0.25, 5) p.CastShadow = false efParts[p] = { vf = vf, att = att, k = k, light = math.clamp(k / 2, 0.3, 1.25), nextToss = timeElapsed + 0.5 + math.random() * 2, } efCount += 1 end -- take house parts away from the main script's weak generic debris force local function takeover() if efCount >= PACK.MaxParts then return end for p, st in pairs(debrisTracked) do if tonumber(p.Name) then debrisTracked[p] = nil debrisCount -= 1 if st.vf then st.vf:Destroy() end if st.att and st.att.Parent then st.att:Destroy() end if p.Parent then adopt(p) end end end end local function stepEF() if efCount == 0 then return end local now = timeElapsed local ef = currentEF local g = workspace.Gravity local peak = currentWindSpeedMPH * contact local liftBase = PACK.LiftFrac[ef] or 0 local maxDist = columnRadius() * PACK.ReleaseDist local core = fieldCore() local tossCfg, tossAccel = PACK.TossEvery[ef], PACK.TossAccel[ef] local ejectCfg = PACK.EjectAfter[ef] for p, st in pairs(efParts) do local vf = st.vf if not p.Parent or not vf.Parent or p.Anchored or p.Position.Y < -2000 then dropEF(p, st) continue end local pos = p.Position local center = centerAt(pos) local dx, dz = pos.X - center.X, pos.Z - center.Z local dist = math.sqrt(dx * dx + dz * dz) if dist > maxDist then dropEF(p, st) continue end if st.coolUntil then if now < st.coolUntil then vf.Force = Vector3.zero continue end st.coolUntil = nil end local mass = p.AssemblyMass if mass <= 0 then continue end local rad = dist > 0.5 and Vector3.new(dx / dist, 0, dz / dist) or Vector3.new(1, 0, 0) local tan = Vector3.new(-rad.Z, 0, rad.X) local accel if st.ejectEnd and now < st.ejectEnd then -- violent ejection out of the vortex accel = st.ejectVec + Vector3.new(0, g * 0.6, 0) elseif st.ejectEnd then -- ejection over: let it fly free for a while st.ejectEnd, st.ejectAt = nil, nil st.coolUntil = now + PACK.Cooldown vf.Force = Vector3.zero continue else local vel = p.AssemblyLinearVelocity local target = fieldAt(pos, center, peak, core) accel = (target - vel) * st.k + Vector3.new(0, g * liftBase * st.light, 0) if tossCfg and now >= st.nextToss then st.nextToss = now + tossCfg[1] + math.random() * (tossCfg[2] - tossCfg[1]) st.tossEnd = now + PACK.TossTime local d = Vector3.new(rad.X * 0.5 + (math.random() - 0.5), 0.5 + math.random() * 0.8, rad.Z * 0.5 + (math.random() - 0.5)) + tan * 0.4 st.tossVec = d.Unit * tossAccel * (0.6 + math.random() * 0.8) p.AssemblyAngularVelocity += Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5) * 10 end if st.tossEnd and now < st.tossEnd and st.tossVec then accel += st.tossVec end if ejectCfg then if not st.ejectAt then st.ejectAt = now + ejectCfg[1] + math.random() * (ejectCfg[2] - ejectCfg[1]) elseif now >= st.ejectAt then st.ejectEnd = now + PACK.EjectTime local d = rad * 0.8 + tan * 0.7 + Vector3.new(0, 0.5 + math.random() * 0.4, 0) st.ejectVec = d.Unit * PACK.EjectAccel * (0.7 + math.random() * 0.6) end end end if accel.Magnitude > 900 then accel = accel.Unit * 900 end vf.Force = accel * mass local av = p.AssemblyAngularVelocity if av.Magnitude > PACK.SpinCap then p.AssemblyAngularVelocity = av.Unit * PACK.SpinCap end end end -- ================================================================ -- CRASHABLE CARS (rig 15030483102) -- ================================================================ local cars = {} local carTemplate local function getCarTemplate() if carTemplate then return carTemplate end local obj = loadAsset(CAR_ID) if not obj then return nil end local model if obj:IsA("Model") then model = obj else model = Instance.new("Model") if obj:IsA("BasePart") then obj.Parent = model else for _, ch in ipairs(obj:GetChildren()) do ch.Parent = model end obj:Destroy() end end carTemplate = model return model end local function spawnCar() local tpl = getCarTemplate() if not tpl then warn("[cars] could not load car rig " .. CAR_ID) return end local model = tpl:Clone() model.Name = "CrashableCar" local seat, biggest, bigV = nil, nil, 0 for _, d in ipairs(model:GetDescendants()) do if d:IsA("LuaSourceContainer") then d:Destroy() elseif d:IsA("BasePart") then d.Anchored = false if tonumber(d.Name) then d.Name = "Car" .. d.Name end carCache[d] = true if d:IsA("VehicleSeat") then seat = d end local v = d.Size.X * d.Size.Y * d.Size.Z if v > bigV then biggest, bigV = d, v end end end local main = model.PrimaryPart or seat or biggest if not main then model:Destroy() return end local center = getFocusPosition() local a = math.random() * math.pi * 2 local dist = PACK.CarMin + math.random() * (PACK.CarMax - PACK.CarMin) local gp = groundAt(center.X + math.cos(a) * dist, center.Z + math.sin(a) * dist) model.Parent = packFolder model:PivotTo(CFrame.new(gp + Vector3.new(0, 40, 0)) * CFrame.Angles(0, math.random() * math.pi * 2, 0)) local bb, size = model:GetBoundingBox() local bottom = bb.Position.Y - size.Y / 2 model:PivotTo(model:GetPivot() + Vector3.new(0, gp.Y + 0.6 - bottom, 0)) cars[#cars + 1] = {model = model, main = main, prevV = Vector3.zero, cd = timeElapsed + 2.5, damage = 0} end local function crashCar(c, dv) c.cd = timeElapsed + 0.6 local power = math.clamp(dv / 90, 0.25, 2.5) c.damage += power local main = c.main local snd = Instance.new("Sound") snd.SoundId = CRASH_SOUND_ID snd.Volume = math.clamp(0.5 + power * 0.9, 0.5, 3) snd.PlaybackSpeed = 0.55 + math.random() * 0.25 snd.RollOffMaxDistance = 1800 snd.Parent = main snd:Play() Debris:AddItem(snd, 5) local sparks = Instance.new("ParticleEmitter") sparks.Texture = "rbxasset://textures/particles/sparkles_main.dds" sparks.Rate = 0 sparks.Lifetime = NumberRange.new(0.3, 0.8) sparks.Speed = NumberRange.new(25, 70) sparks.SpreadAngle = Vector2.new(180, 180) sparks.Acceleration = Vector3.new(0, -80, 0) sparks.Size = NumberSequence.new(1.4, 0) sparks.LightEmission = 1 sparks.Color = ColorSequence.new(Color3.fromRGB(255, 190, 80)) sparks.Parent = main sparks:Emit(math.floor(12 + power * 16)) Debris:AddItem(sparks, 3) local want = math.floor(power * 1.5 + math.random()) if want > 0 then local cand = {} local lim = main.Size.Magnitude * 0.9 for _, p in ipairs(c.model:GetDescendants()) do if p:IsA("BasePart") and p ~= main and not p:IsA("VehicleSeat") and not p:GetAttribute("Loose") and p.Size.Magnitude < lim then cand[#cand + 1] = p end end for _ = 1, math.min(want, #cand) do local p = table.remove(cand, math.random(#cand)) p:SetAttribute("Loose", true) for _, j in ipairs(p:GetJoints()) do pcall(function() j:Destroy() end) end local dir = Vector3.new(math.random() - 0.5, 0.4 + math.random() * 0.6, math.random() - 0.5).Unit p:ApplyImpulse(dir * p.AssemblyMass * (25 + 35 * power)) end end if c.damage > 2.5 and not c.smoke then local smoke = Instance.new("ParticleEmitter") smoke.Texture = "rbxasset://textures/particles/smoke_main.dds" smoke.Rate = 18 smoke.Lifetime = NumberRange.new(2, 3.5) smoke.Speed = NumberRange.new(4, 9) smoke.Acceleration = Vector3.new(0, 6, 0) smoke.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 12)}) smoke.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.5), NumberSequenceKeypoint.new(1, 1)}) smoke.Color = ColorSequence.new(Color3.fromRGB(40, 40, 40)) smoke.Rotation = NumberRange.new(0, 360) smoke.Parent = main c.smoke = smoke end if c.damage > 6 and not c.fire then local fire = Instance.new("Fire") fire.Size = 9 fire.Heat = 6 fire.Parent = main c.fire = fire end end local function stepCars() for i = #cars, 1, -1 do local c = cars[i] if not c.model.Parent or not c.main.Parent then table.remove(cars, i) else local v = c.main.AssemblyLinearVelocity local dv = (v - c.prevV).Magnitude c.prevV = v if timeElapsed >= c.cd and dv > PACK.CrashDV then crashCar(c, dv) end end end end -- ================================================================ -- NPCs: hand-built R6 rigs, procedural walk, flee, get sucked + thrown -- ================================================================ local npcs = {} local hitNPC, killNPC, knockNPC local SKIN = { Color3.fromRGB(255, 204, 153), Color3.fromRGB(234, 184, 146), Color3.fromRGB(198, 134, 66), Color3.fromRGB(124, 92, 70), Color3.fromRGB(255, 224, 189), } local CLOTH = { Color3.fromRGB(196, 40, 28), Color3.fromRGB(13, 105, 172), Color3.fromRGB(75, 151, 75), Color3.fromRGB(245, 205, 48), Color3.fromRGB(98, 37, 209), Color3.fromRGB(40, 40, 40), Color3.fromRGB(218, 133, 65), Color3.fromRGB(235, 235, 235), } local C = CFrame.new local rootC = C(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) local neckC0 = C(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) local neckC1 = C(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) local rsC0 = C(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) local rsC1 = C(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) local lsC0 = C(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) local lsC1 = C(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) local rhC0 = C(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) local rhC1 = C(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) local lhC0 = C(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) local lhC1 = C(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) local function mkPart(parent, name, size, color) local p = Instance.new("Part") p.Name = name p.Size = size p.Color = color p.Material = Enum.Material.SmoothPlastic p.TopSurface = Enum.SurfaceType.Smooth p.BottomSurface = Enum.SurfaceType.Smooth p.Parent = parent return p end local function mkJoint(name, p0, p1, c0, c1) local m = Instance.new("Motor6D") m.Name = name m.Part0, m.Part1 = p0, p1 m.C0, m.C1 = c0, c1 m.Parent = p0 return m end local npcRay = RaycastParams.new() npcRay.FilterType = Enum.RaycastFilterType.Exclude local function releaseNPCForce(n) if n.vf then n.vf:Destroy() n.vf = nil end if n.att then n.att:Destroy() n.att = nil end end local function standUp(n) releaseNPCForce(n) local hrp = n.hrp local _, yaw = hrp.CFrame:ToEulerAnglesYXZ() hrp.AssemblyLinearVelocity = Vector3.zero hrp.AssemblyAngularVelocity = Vector3.zero hrp.CFrame = CFrame.new(hrp.Position + Vector3.new(0, 2.5, 0)) * CFrame.Angles(0, yaw, 0) n.hum.PlatformStand = false n.hum:ChangeState(Enum.HumanoidStateType.GettingUp) n.hum.WalkSpeed = n.walkSpeed n.mode = "walk" n.nextWander = 0 end function killNPC(n) if n.mode == "dead" then return end n.mode = "dead" releaseNPCForce(n) for _, d in ipairs(n.model:GetDescendants()) do if d:IsA("Motor6D") then d:Destroy() end end n.hum.Health = 0 Debris:AddItem(n.model, 25) end function knockNPC(n, other) n.mode = "down" n.downUntil = timeElapsed + 2.5 n.hum.PlatformStand = true local away = n.hrp.Position - other.Position away = Vector3.new(away.X, 0, away.Z) away = (away.Magnitude > 0.1) and away.Unit or Vector3.new(1, 0, 0) local m = n.hrp.AssemblyMass n.hrp:ApplyImpulse(away * m * 40 + Vector3.new(0, m * 25, 0)) end function hitNPC(n, other) if n.mode == "dead" or timeElapsed < n.hitCD then return end if other.Anchored or other:IsDescendantOf(n.model) then return end local rel = (other.AssemblyLinearVelocity - n.hrp.AssemblyLinearVelocity).Magnitude if rel < PACK.HitSpeed or other.AssemblyMass < 1.5 then return end n.hitCD = timeElapsed + 0.5 if rel > PACK.KillSpeed then killNPC(n) elseif n.mode == "walk" then knockNPC(n, other) end end local function buildNPC(pos) local model = Instance.new("Model") model.Name = "TornadoNPC" local skin = SKIN[math.random(#SKIN)] local shirt = CLOTH[math.random(#CLOTH)] local pants = CLOTH[math.random(#CLOTH)] local base = CFrame.new(pos + Vector3.new(0, 3.05, 0)) * CFrame.Angles(0, math.random() * math.pi * 2, 0) local hrp = mkPart(model, "HumanoidRootPart", Vector3.new(2, 2, 1), skin) hrp.Transparency = 1 hrp.CanCollide = false local torso = mkPart(model, "Torso", Vector3.new(2, 2, 1), shirt) local head = mkPart(model, "Head", Vector3.new(2, 1, 1), skin) local rArm = mkPart(model, "Right Arm", Vector3.new(1, 2, 1), skin) local lArm = mkPart(model, "Left Arm", Vector3.new(1, 2, 1), skin) local rLeg = mkPart(model, "Right Leg", Vector3.new(1, 2, 1), pants) local lLeg = mkPart(model, "Left Leg", Vector3.new(1, 2, 1), pants) hrp.CFrame = base torso.CFrame = base head.CFrame = base * CFrame.new(0, 1.5, 0) rArm.CFrame = base * CFrame.new(1.5, 0, 0) lArm.CFrame = base * CFrame.new(-1.5, 0, 0) rLeg.CFrame = base * CFrame.new(0.5, -2, 0) lLeg.CFrame = base * CFrame.new(-0.5, -2, 0) local mesh = Instance.new("SpecialMesh") mesh.MeshType = Enum.MeshType.Head mesh.Scale = Vector3.new(1.25, 1.25, 1.25) mesh.Parent = head local face = Instance.new("Decal") face.Name = "face" face.Texture = "rbxasset://textures/face.png" face.Face = Enum.NormalId.Front face.Parent = head mkJoint("RootJoint", hrp, torso, rootC, rootC) mkJoint("Neck", torso, head, neckC0, neckC1) local rs = mkJoint("Right Shoulder", torso, rArm, rsC0, rsC1) local ls = mkJoint("Left Shoulder", torso, lArm, lsC0, lsC1) local rh = mkJoint("Right Hip", torso, rLeg, rhC0, rhC1) local lh = mkJoint("Left Hip", torso, lLeg, lhC0, lhC1) local ws = 8 + math.random() * 6 local hum = Instance.new("Humanoid") hum.RigType = Enum.HumanoidRigType.R6 hum.HipHeight = 0 hum.WalkSpeed = ws hum.BreakJointsOnDeath = false hum.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None hum.Parent = model model.PrimaryPart = hrp model.Parent = packFolder local n = { model = model, hrp = hrp, hum = hum, rs = rs, ls = ls, rh = rh, lh = lh, mode = "walk", phase = math.random() * 6, walkSpeed = ws, home = pos, nextThink = 0, nextWander = 0, cool = 0, hitCD = 0, lastSp = 0, lastPos = pos, lastCheck = timeElapsed, fleeSide = (math.random() < 0.5) and 1 or -1, } npcs[#npcs + 1] = n local function onHit(o) hitNPC(n, o) end torso.Touched:Connect(onHit) head.Touched:Connect(onHit) return n end local function spawnNPC() local center = getFocusPosition() local a = math.random() * math.pi * 2 local d = PACK.NpcMin + math.random() * (PACK.NpcMax - PACK.NpcMin) buildNPC(groundAt(center.X + math.cos(a) * d, center.Z + math.sin(a) * d)) end local function startSuck(n, now) releaseNPCForce(n) n.mode = "sucked" n.t0 = now n.dur = 7 + math.random() * 6 n.hum.PlatformStand = true local att = Instance.new("Attachment") att.Name = "TornadoAtt" att.Parent = n.hrp local vf = Instance.new("VectorForce") vf.Name = "TornadoForce" vf.Attachment0 = att vf.RelativeTo = Enum.ActuatorRelativeTo.World vf.ApplyAtCenterOfMass = true vf.Force = Vector3.zero vf.Parent = n.hrp n.att, n.vf = att, vf end local function thinkNPC(n, now, dist, dx, dz, colR) local hrp, hum = n.hrp, n.hum local pos = hrp.Position if descendProgress > 0.25 and dist < colR * 3.2 then hum.WalkSpeed = 24 local away = Vector3.new(dx, 0, dz) away = (away.Magnitude > 1) and away.Unit or Vector3.new(1, 0, 0) local side = Vector3.new(-away.Z, 0, away.X) * n.fleeSide hum:MoveTo(pos + (away + side * 0.6).Unit * 90) n.fleeing = true return end if n.fleeing then n.fleeing = false hum.WalkSpeed = n.walkSpeed n.nextWander = 0 end if now >= n.nextWander then if math.random() < 0.3 then hum:MoveTo(pos) n.nextWander = now + 2 + math.random() * 4 else local a = math.random() * math.pi * 2 local d = 20 + math.random() * 60 local tx, tz = pos.X + math.cos(a) * d, pos.Z + math.sin(a) * d local hx, hz = n.home.X - pos.X, n.home.Z - pos.Z if hx * hx + hz * hz > 300 * 300 then tx = n.home.X + (math.random() - 0.5) * 80 tz = n.home.Z + (math.random() - 0.5) * 80 end hum:MoveTo(Vector3.new(tx, pos.Y, tz)) n.nextWander = now + 4 + math.random() * 6 end end if now - n.lastCheck >= 1 then if hum.MoveDirection.Magnitude > 0.1 and (pos - n.lastPos).Magnitude < 1.2 then hum.Jump = true n.nextWander = 0 end n.lastPos, n.lastCheck = pos, now end end local function animateNPC(n, dt, now) local sw if n.mode == "walk" then local v = n.hrp.AssemblyLinearVelocity local sp = math.sqrt(v.X * v.X + v.Z * v.Z) n.phase += dt * sp * 0.6 sw = math.sin(n.phase) * math.clamp(sp / 10, 0, 1) * 0.9 else sw = math.sin(now * 9 + n.phase) * 1.3 end n.rs.C0 = rsC0 * CFrame.Angles(0, 0, -sw) n.ls.C0 = lsC0 * CFrame.Angles(0, 0, -sw) n.rh.C0 = rhC0 * CFrame.Angles(0, 0, sw) n.lh.C0 = lhC0 * CFrame.Angles(0, 0, sw) end local function stepNPCs(dt) if #npcs == 0 then return end local now = timeElapsed local g = workspace.Gravity local colR = columnRadius() local groundR = colR * (0.4 + 0.6 * descendProgress) local core = fieldCore() local peak = currentWindSpeedMPH * contact local liftBase = PACK.LiftFrac[currentEF] or 0 for i = #npcs, 1, -1 do local n = npcs[i] local hrp = n.hrp if not n.model.Parent then table.remove(npcs, i) elseif n.mode ~= "dead" then local pos = hrp.Position local dx, dz = pos.X - liveStormPos.X, pos.Z - liveStormPos.Z local dist = math.sqrt(dx * dx + dz * dz) if n.mode == "walk" or n.mode == "down" then if contact >= 0.6 and now >= n.cool and dist < groundR * 1.3 and pos.Y - liveStormPos.Y < 300 then startSuck(n, now) elseif n.mode == "down" then if now >= n.downUntil then standUp(n) end elseif now >= n.nextThink then n.nextThink = now + 0.4 thinkNPC(n, now, dist, dx, dz, colR) end end if n.mode == "sucked" then local center = centerAt(pos) local h01 = math.clamp((pos.Y - center.Y) / sm.Height, 0, 1) local target = fieldAt(pos, center, peak, core) local vel = hrp.AssemblyLinearVelocity local up = (h01 < 0.7) and math.max(liftBase, 0.85) or 0.2 local accel = (target - vel) * 1.4 + Vector3.new(0, g * up, 0) if accel.Magnitude > 700 then accel = accel.Unit * 700 end n.vf.Force = accel * hrp.AssemblyMass hrp.AssemblyAngularVelocity = Vector3.new( math.sin(now * 1.7 + n.phase) * 2.5, math.sin(now * 1.1) * 3.5, math.cos(now * 1.3 + n.phase) * 2.5) if now - n.t0 >= n.dur then local rx, rz = pos.X - center.X, pos.Z - center.Z local d = math.max(math.sqrt(rx * rx + rz * rz), 1) local rad = Vector3.new(rx / d, 0, rz / d) local tan = Vector3.new(-rad.Z, 0, rad.X) releaseNPCForce(n) hrp.AssemblyLinearVelocity = rad * 260 + tan * 200 + Vector3.new(0, 150, 0) n.mode = "thrown" n.t1 = now n.cool = now + 25 n.lastSp = 0 end elseif n.mode == "thrown" then local sp = hrp.AssemblyLinearVelocity.Magnitude local landed = false if now - n.t1 > 0.7 then npcRay.FilterDescendantsInstances = {n.model, funnelFolder} local hit = workspace:Raycast(hrp.Position, Vector3.new(0, -5, 0), npcRay) if hit and hrp.AssemblyLinearVelocity.Y < 10 then landed = true end if now - n.t1 > 25 then landed = true end end if landed then if n.lastSp > PACK.DeathSpeed then killNPC(n) else standUp(n) end end n.lastSp = sp end if n.mode ~= "dead" then animateNPC(n, dt, now) end end end end -- ================================================================ -- GUI buttons (added to the existing scrolling control panel) -- ================================================================ local function clearAll() for i = #cars, 1, -1 do cars[i].model:Destroy() table.remove(cars, i) end for i = #npcs, 1, -1 do npcs[i].model:Destroy() table.remove(npcs, i) end end local function addButtons() local sg = Player.PlayerGui:FindFirstChild("TornadoControls") local scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if not scroll then return end local function btn(text, color, order, fn) local b = Instance.new("TextButton") b.LayoutOrder = order b.Size = UDim2.new(1, -6, 0, 20) b.BackgroundColor3 = color b.Text = text b.TextColor3 = Color3.new(1, 1, 1) b.Font = Enum.Font.SourceSansBold b.TextSize = 11 b.Parent = scroll Instance.new("UICorner", b) b.MouseButton1Click:Connect(fn) end btn("SPAWN CARS", Color3.fromRGB(60, 100, 160), 100, function() task.spawn(function() for _ = 1, 3 do spawnCar() end end) end) btn("SPAWN NPCS", Color3.fromRGB(60, 140, 90), 101, function() for _ = 1, 5 do spawnNPC() end end) btn("CLEAR CARS/NPCS", Color3.fromRGB(140, 60, 60), 102, clearAll) end -- ================================================================ -- MAIN LOOP -- ================================================================ local acc = 0 RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) if next(debrisTracked) then takeover() end acc += dt if acc >= PACK.StepEvery then acc = 0 stepEF() end stepCars() stepNPCs(dt) end) addButtons() task.wait(2) for _ = 1, PACK.Npcs do spawnNPC() end for _ = 1, PACK.Cars do spawnCar() end end) if timeElapsed - lastHouseStep > 0.1 then lastHouseStep = timeElapsed local force = stats.Force * HOUSE_FORCE_MUL local g = workspace.Gravity local maxDist2 = (colR * 8) ^ 2 local orbitPos = orbitCube.Position for p, st in pairs(houseTracked) do local drop = false if not p.Parent or not st.vf.Parent or p.Anchored or p.Position.Y < -2000 then drop = true else local pos = p.Position local dx, dz = pos.X - stormPos.X, pos.Z - stormPos.Z if dx * dx + dz * dz > maxDist2 then drop = true elseif contact < 0.2 then st.vf.Force = Vector3.zero else local spatialVec = calculateSpatialWindVector(pos, stormPos, windSm, contact) local toOrbit = orbitPos - pos local pullDir = toOrbit.Magnitude > 0.1 and (toOrbit.Unit * force) or Vector3.zero local lift = Vector3.zero if timeElapsed - st.lastLift >= HOUSE_LIFT_EVERY then st.lastLift = timeElapsed lift = Vector3.new(0, p:GetMass() * g * HOUSE_LIFT_MUL, 0) end st.vf.Force = pullDir + spatialVec * HOUSE_WIND_MUL + lift local v = p.AssemblyLinearVelocity if v.Magnitude > HOUSE_MAX_SPEED then p.AssemblyLinearVelocity = v.Unit * HOUSE_MAX_SPEED end end end if drop then houseTracked[p] = nil houseCount -= 1 if st.vf.Parent then st.vf:Destroy() end if st.att.Parent then st.att:Destroy() end end end end -- ==================================================================== -- [[ HIGHER SUPERCELL ]] -- PASTE THIS AT THE VERY BOTTOM of your tornado script. No other edits. -- -- Lifts the whole cell (cloud base, wall cloud, towers, anvil, lightning -- origin) higher in the sky. The funnel is made taller by the same -- amount so it still reaches the cloud base. -- ==================================================================== do local CELL = { Raise = 1200, -- studs to lift the cell. 0 = original height. Bigger = higher } -- everything in the script reads FIXED_HEIGHT each frame: -- cloud base = funnel height + CLOUD_BASE_OFFSET, so the whole cell rises with it FIXED_HEIGHT = FIXED_HEIGHT + CELL.Raise end -- ==================================================================== -- [[ TORNADO SIDE SHADING ]] -- PASTE THIS AT THE VERY BOTTOM of your tornado script (works with or -- without the El Reno add-on). No other edits. -- -- One side of the funnel is lit, the opposite side falls into shadow, -- so the tornado keeps a visible 3D form and silhouette even against -- clouds of the same color. -- ==================================================================== task.spawn(function() local SHADE = { Strength = 0.50, -- how dark the shadowed side gets (0 = none, 0.5 = half brightness) Soften = 0.15, -- keeps the lit/shadow edge soft (0..0.4) CameraRelative = false, -- true = lit side is always the camera's right side LightDir = Vector3.new(0.7, 0, -0.7), -- horizontal light direction (toward the light) when CameraRelative is false UseSun = true, -- use the sun's horizontal direction when it is strong enough Darken = 1.0, -- overall funnel brightness multiplier } local function lightFlat() if SHADE.CameraRelative then local cam = workspace.CurrentCamera if cam then local r = cam.CFrame.RightVector local v = Vector3.new(r.X, 0, r.Z) if v.Magnitude > 0.05 then return v.Unit end end end if SHADE.UseSun then local s = Lighting:GetSunDirection() local v = Vector3.new(s.X, 0, s.Z) if v.Magnitude > 0.35 then return v.Unit end end local v = Vector3.new(SHADE.LightDir.X, 0, SHADE.LightDir.Z) return v.Magnitude > 0.01 and v.Unit or Vector3.new(0.7, 0, -0.7) end RunService:BindToRenderStep("TornadoSideShade", Enum.RenderPriority.Last.Value, function() if funnelHidden then return end local L = lightFlat() local lx, lz = L.X, L.Z local strength, soften, darken = SHADE.Strength, SHADE.Soften, SHADE.Darken local t = timeElapsed for _, d in ipairs(funnel) do -- outward direction of this particle around the funnel local rad = math.rad(d.ang) local lit = math.cos(rad) * lx + math.sin(rad) * lz -- 1 = facing the light, -1 = facing away lit = math.clamp(lit * (1 + soften) , -1, 1) local f = (1 - strength * (1 - lit) * 0.5) * darken -- same base shade the main script uses, then the side factor on top local shade = 0.88 + d.pr * 0.14 + d.shade + math.noise(t * 0.2, d.seed) * 0.06 - currentEF * 0.012 + d.ex * 0.06 local c = tint(math.clamp(shade, 0.7, 1.2)) d.img.ImageColor3 = Color3.new( math.clamp(c.R * f, 0, 1), math.clamp(c.G * f, 0, 1), math.clamp(c.B * f, 0, 1) ) end end) end) -- ==================================================================== -- [[ PROBE RESTYLE: real cone mesh + propeller anemometer ]] -- PASTE THIS AT THE VERY BOTTOM of your tornado script. No other edits. -- -- It rebuilds every TornadoProbe (the starting one and any you deploy) -- to match your drawing: -- * orange REAL cone mesh base -- * black pole -- * left arm: anemometer with a propeller at the FRONT. It turns to face -- into the wind and the propeller spins faster as the wind speeds up -- * right arm: stack of grey discs -- The wind/pressure label and radar markers keep working as before. -- ==================================================================== task.spawn(function() local AssetService = game:GetService("AssetService") local PROBE = { ConeMeshId = "rbxassetid://1033714", -- cone mesh (swap this id if it isn't a cone) ConeRot = CFrame.Angles(0, 0, 0), -- use CFrame.Angles(math.pi, 0, 0) if the cone is upside down ConeSize = Vector3.new(16, 4.5, 16), SpinPerMph = 0.55, -- propeller rad/s per mph of wind MaxSpin = 40, -- cap so it never looks frozen from frame aliasing SpinResponse = 2.0, -- how quickly the propeller speeds up / slows down TurnResponse = 3.0, -- how quickly the anemometer turns into the wind UpdateRange = 1500, -- probes farther than this from the camera aren't animated } local ORANGE = Color3.fromRGB(255, 170, 0) local BLACK = Color3.fromRGB(15, 15, 15) local LGREY = Color3.fromRGB(208, 208, 208) local MGREY = Color3.fromRGB(165, 165, 165) local RAD90 = math.rad(90) local TAU = math.pi * 2 local PIVOT = CFrame.new(-5, 14.8, 0) -- anemometer pivot, in probe space local PROP_X = 3.15 -- propeller position in front of the pivot -- ================================================================ -- CONE MESH (loaded once, cloned per probe) -- ================================================================ local coneTemplate local coneState = "idle" local function getCone() if coneState == "loading" then while coneState == "loading" do task.wait() end elseif coneState == "idle" then coneState = "loading" local ok, mp = pcall(function() return AssetService:CreateMeshPartAsync(Content.fromUri(PROBE.ConeMeshId)) end) if not ok or not mp then ok, mp = pcall(function() return AssetService:CreateMeshPartAsync(PROBE.ConeMeshId) end) end if ok and mp then coneTemplate = mp end coneState = "done" if not coneTemplate then warn("[probe] cone mesh failed to load, using stacked discs instead") end end return coneTemplate end -- ================================================================ -- WIND AT A PROBE (same model the probe label uses) -- ================================================================ local function windAt(pos) local rx, rz = pos.X - liveStormPos.X, pos.Z - liveStormPos.Z local d = math.max(math.sqrt(rx * rx + rz * rz), 1) local widthScale = 0.4 + 0.6 * descendProgress local Rc = math.max(columnRadius() * widthScale * 0.5, 60) local amb = math.max(6 + 20 * supercellProgress + math.noise(timeElapsed * 0.4, pos.X * 0.01) * 10, 0) local vort = 0 if contact > 0 then local peak = currentWindSpeedMPH * contact vort = (d < Rc) and peak * (d / Rc) or peak * (Rc / d) ^ 1.1 end local gust = math.noise(timeElapsed * 0.2, pos.Z * 0.01) * 0.7 local ambDir = CFrame.Angles(0, gust, 0) * Vector3.new(targetDirection.X, 0, targetDirection.Z) local radX, radZ = rx / d, rz / d local tor = Vector3.new(-radZ - radX * 0.45, 0, radX - radZ * 0.45).Unit -- spin + inflow return ambDir * amb + tor * vort, amb + vort end -- ================================================================ -- BUILDING -- ================================================================ local active = {} local function mk(model, size, cf, color, mat, solid, cyl) local p = Instance.new("Part") p.Name = "ProbePart" p.Size = size p.CFrame = cf p.Color = color p.Material = mat or Enum.Material.Metal p.TopSurface = Enum.SurfaceType.Smooth p.BottomSurface = Enum.SurfaceType.Smooth p.Anchored = true p.CanCollide = solid == true p.CanQuery = solid == true p.CanTouch = false p.CastShadow = solid == true if cyl then p.Shape = Enum.PartType.Cylinder end p.Parent = model return p end local function findAnchor(model) for _, p in ipairs(model:GetChildren()) do if p:IsA("BasePart") and p:FindFirstChildOfClass("BillboardGui") then return p end end end local function restyle(model) if model:GetAttribute("Restyled") then return true end local anchor = findAnchor(model) if not anchor then return false end model:SetAttribute("Restyled", true) local cone = getCone() -- may yield the first time if not model.Parent or not anchor.Parent then return true end -- the original anchor sits at 20 studs above the probe base local B = anchor.CFrame * CFrame.new(0, -20, 0) for _, p in ipairs(model:GetChildren()) do if p ~= anchor then p:Destroy() end end anchor.CFrame = B * CFrame.new(0, 21, 0) -- cone base local cs = PROBE.ConeSize if cone then local c = cone:Clone() c.Name = "ProbeCone" c.Size = cs c.CFrame = B * CFrame.new(0, cs.Y / 2 - 0.1, 0) * PROBE.ConeRot c.Color = ORANGE c.Material = Enum.Material.SmoothPlastic c.Anchored = true c.CanCollide, c.CanQuery, c.CanTouch = true, true, false c.CollisionFidelity = Enum.CollisionFidelity.Hull c.Parent = model else for i = 0, 5 do local w = cs.X - i * (cs.X / 6.2) mk(model, Vector3.new(w, cs.Y / 6, w), B * CFrame.new(0, cs.Y / 12 + i * cs.Y / 6, 0), ORANGE, Enum.Material.SmoothPlastic, true) end end -- pole mk(model, Vector3.new(0.6, 9, 0.6), B * CFrame.new(0, 8, 0), BLACK, Enum.Material.Metal, true) -- right arm: stacked grey discs mk(model, Vector3.new(5.6, 0.5, 0.5), B * CFrame.new(2.5, 7, 0), BLACK, Enum.Material.Metal, true) mk(model, Vector3.new(0.5, 2.9, 0.5), B * CFrame.new(5, 8.45, 0), BLACK, Enum.Material.Metal, true) local widths = {5.2, 5.9, 5.6, 4.8, 3.6} for i, w in ipairs(widths) do mk(model, Vector3.new(1.1, w, w), B * CFrame.new(5, 10.25 + (i - 1) * 1.1, 0) * CFrame.Angles(0, 0, RAD90), (i % 2 == 0) and LGREY or MGREY, Enum.Material.SmoothPlastic, true, true) end -- left arm: up to the anemometer pivot mk(model, Vector3.new(5.6, 0.5, 0.5), B * CFrame.new(-2.5, 12.2, 0), BLACK, Enum.Material.Metal, true) mk(model, Vector3.new(0.5, 2.6, 0.5), B * CFrame.new(-5, 13.5, 0), BLACK, Enum.Material.Metal, true) -- anemometer (front = +X in pivot space) local parts, rigidLocal = {}, {} local function addRigid(size, lcf, color, mat, cyl) local p = mk(model, size, B * PIVOT * lcf, color, mat, false, cyl) parts[#parts + 1] = p rigidLocal[#parts] = lcf end addRigid(Vector3.new(4.0, 1.5, 1.5), CFrame.new(-0.2, 0, 0), LGREY, Enum.Material.Metal, true) -- body addRigid(Vector3.new(2.6, 2.7, 2.7), CFrame.new(-3.5, 0, 0), LGREY, Enum.Material.Metal, true) -- tail flare addRigid(Vector3.new(0.9, 1.3, 1.3), CFrame.new(2.25, 0, 0), BLACK, Enum.Material.Metal, true) -- nose addRigid(Vector3.new(0.5, 0.8, 0.8), CFrame.new(PROP_X, 0, 0), BLACK, Enum.Material.Metal, true) -- hub addRigid(Vector3.new(2.2, 2.4, 0.2), CFrame.new(-4.2, 1.5, 0), BLACK, Enum.Material.Metal, false) -- tail fin local rigidCount = #parts for _ = 1, 3 do local blade = mk(model, Vector3.new(0.14, 2.4, 1.0), B * PIVOT, BLACK, Enum.Material.Metal, false) parts[#parts + 1] = blade end local cfs = table.create(#parts, CFrame.identity) active[#active + 1] = { model = model, B = B, parts = parts, cfs = cfs, rigidLocal = rigidLocal, rigidCount = rigidCount, yaw = math.random() * TAU, spin = 0, spinVel = 0, vec = Vector3.zero, speed = 0, nextWind = 0, } return true end -- ================================================================ -- ANIMATION: face into the wind, propeller spins with wind speed -- ================================================================ RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) local focus = getFocusPosition() for i = #active, 1, -1 do local st = active[i] if not st.model.Parent then table.remove(active, i) elseif (st.B.Position - focus).Magnitude < PROBE.UpdateRange then st.nextWind -= dt if st.nextWind <= 0 then st.nextWind = 0.1 st.vec, st.speed = windAt(st.B.Position + Vector3.new(0, 15, 0)) end -- turn so the propeller faces into the wind if st.vec.Magnitude > 0.5 then local target = math.atan2(st.vec.Z, -st.vec.X) local diff = (target - st.yaw + math.pi) % TAU - math.pi st.yaw += diff * (1 - math.exp(-dt * PROBE.TurnResponse)) end -- propeller speed follows wind speed, with some inertia local targetSpin = math.min(st.speed * PROBE.SpinPerMph, PROBE.MaxSpin) st.spinVel += (targetSpin - st.spinVel) * (1 - math.exp(-dt * PROBE.SpinResponse)) st.spin = (st.spin + st.spinVel * dt) % TAU local P = st.B * PIVOT * CFrame.Angles(0, st.yaw, 0) for k = 1, st.rigidCount do st.cfs[k] = P * st.rigidLocal[k] end for b = 0, 2 do st.cfs[st.rigidCount + b + 1] = P * CFrame.new(PROP_X, 0, 0) * CFrame.Angles(st.spin + b * TAU / 3, 0, 0) * CFrame.new(0, 1.5, 0) * CFrame.Angles(0, math.rad(28), 0) -- blade pitch end workspace:BulkMoveTo(st.parts, st.cfs, Enum.BulkMoveMode.FireCFrameChanged) end end end) -- ================================================================ -- HOOK INTO EVERY PROBE (existing + newly deployed) -- ================================================================ local tools = workspace:WaitForChild("TornadoTools", 15) if not tools then warn("[probe] TornadoTools folder not found") return end local function handle(model) if not model:IsA("Model") or model.Name ~= "TornadoProbe" then return end task.spawn(function() local waited = 0 while model.Parent and not restyle(model) and waited < 3 do waited += task.wait() end end) end tools.ChildAdded:Connect(handle) for _, c in ipairs(tools:GetChildren()) do handle(c) end end) -- ==================================================================== -- [[ STORM SHELTERS ]] -- PASTE THIS AT THE VERY BOTTOM of your tornado script (after the -- DISASTER PACK block). Nothing else needs editing. -- -- * Concrete bunkers with a sliding door (walk up to the doorway -> prompt) -- * Inside a shelter, EVERY sound outside is muffled: tornado roar, rain, -- thunder, sirens, crashes, even sounds from the game itself -- * Door open = partly muffled, door closed = heavily muffled -- * Your own character's sounds (footsteps etc.) are NOT muffled -- * The roof also stops the tornado suction (your script's isIndoors check) -- ==================================================================== task.spawn(function() local TweenService = game:GetService("TweenService") local SHELTER = { Count = 2, -- shelters auto-built around you at start MinDist = 45, MaxDist = 110, Width = 12, -- interior size Depth = 14, Height = 9, Wall = 2, DoorWidth = 6, DoorHeight = 7, DoorSpeed = 2.2, -- door open/close speed -- muffling (door open -> door closed) OpenVolume = 0.50, ClosedVolume = 0.12, OpenHigh = -18, ClosedHigh = -42, -- treble cut (dB) OpenMid = -6, ClosedMid = -14, -- mid cut (dB) BoostLow = 3, -- slight low rumble through the walls Blend = 4, -- how fast the muffle fades in/out } local W, D, H, T = SHELTER.Width, SHELTER.Depth, SHELTER.Height, SHELTER.Wall local DW, DH = SHELTER.DoorWidth, SHELTER.DoorHeight local OPEN_OFFSET = -(DW + 0.4) local CONCRETE = Color3.fromRGB(128, 130, 134) local DARK = Color3.fromRGB(88, 90, 95) local DOORCOL = Color3.fromRGB(190, 70, 40) local shelterFolder = Instance.new("Folder") shelterFolder.Name = "StormShelters" shelterFolder.Parent = workspace -- ================================================================ -- SOUND MUFFLING -- ================================================================ local group = Instance.new("SoundGroup") group.Name = "OutsideSounds" group.Volume = 1 group.Parent = SoundService local eq = Instance.new("EqualizerSoundEffect") eq.Name = "ShelterMuffle" eq.HighGain, eq.MidGain, eq.LowGain = 0, 0, 0 eq.Parent = group local function adopt(d) if not d:IsA("Sound") then return end if d.SoundGroup or d:GetAttribute("ShelterIgnore") then return end if d:IsDescendantOf(shelterFolder) then return end local m = d:FindFirstAncestorOfClass("Model") if m and m.Name == Player.Name and m:FindFirstChildOfClass("Humanoid") then return end d.SoundGroup = group end for _, d in ipairs(workspace:GetDescendants()) do adopt(d) end for _, d in ipairs(SoundService:GetDescendants()) do adopt(d) end workspace.DescendantAdded:Connect(adopt) SoundService.DescendantAdded:Connect(adopt) -- ================================================================ -- BUILDING A SHELTER -- ================================================================ local shelters = {} local function mk(s, size, lcf, color, mat) local p = Instance.new("Part") p.Name = "Shelter" p.Anchored = true p.Size = size p.CFrame = s.cf * lcf p.Color = color p.Material = mat or Enum.Material.Concrete p.TopSurface = Enum.SurfaceType.Smooth p.BottomSurface = Enum.SurfaceType.Smooth p.Parent = s.model return p end local function smooth(x) return x * x * (3 - 2 * x) end local function setDoor(s) s.door.CFrame = s.cf * s.doorLocal * CFrame.new(OPEN_OFFSET * smooth(s.alpha), 0, 0) s.door.CanCollide = s.alpha < 0.9 end local function buildShelter(cf) local s = {cf = cf, model = Instance.new("Model"), open = true, alpha = 1} s.model.Name = "StormShelter" s.model.Parent = shelterFolder local outerW = W + 2 * T local wallY = 1 + H / 2 -- thick floor (buried so it sits flush on slopes) mk(s, Vector3.new(outerW, 6, D + 2 * T), CFrame.new(0, -2, 0), DARK) -- back + side walls mk(s, Vector3.new(outerW, H, T), CFrame.new(0, wallY, -(D / 2 + T / 2)), CONCRETE) mk(s, Vector3.new(T, H, D), CFrame.new(-(W / 2 + T / 2), wallY, 0), CONCRETE) mk(s, Vector3.new(T, H, D), CFrame.new((W / 2 + T / 2), wallY, 0), CONCRETE) -- front wall with doorway local sideW = (outerW - DW) / 2 local fz = D / 2 + T / 2 mk(s, Vector3.new(sideW, H, T), CFrame.new(-(DW / 2 + sideW / 2), wallY, fz), CONCRETE) mk(s, Vector3.new(sideW, H, T), CFrame.new((DW / 2 + sideW / 2), wallY, fz), CONCRETE) mk(s, Vector3.new(DW, H - DH, T), CFrame.new(0, 1 + DH + (H - DH) / 2, fz), CONCRETE) -- roof local roof = mk(s, Vector3.new(outerW + 2, T, D + 2 * T + 2), CFrame.new(0, 1 + H + T / 2, 0), DARK) -- sliding door (in front of the doorway, slides sideways along the wall) s.doorLocal = CFrame.new(0, 1 + DH / 2, D / 2 + T + 0.4) s.door = mk(s, Vector3.new(DW + 0.6, DH, 0.8), CFrame.new(), DOORCOL, Enum.Material.Metal) s.door.Name = "ShelterDoor" setDoor(s) -- interior: bench + ceiling lamp mk(s, Vector3.new(W - 4, 1, 2), CFrame.new(0, 1.5, -D / 2 + 1.2), Color3.fromRGB(110, 78, 50), Enum.Material.Wood) local lamp = mk(s, Vector3.new(4, 0.4, 1.2), CFrame.new(0, 1 + H - 0.2, 0), Color3.fromRGB(255, 230, 170), Enum.Material.Neon) lamp.CanCollide = false local light = Instance.new("PointLight") light.Range, light.Brightness = 28, 1.5 light.Color = Color3.fromRGB(255, 230, 180) light.Parent = lamp -- door prompt (fixed part in the doorway so it doesn't slide away) local pp = mk(s, Vector3.new(1, 1, 1), CFrame.new(0, 3, D / 2 + T / 2), CONCRETE) pp.Transparency = 1 pp.CanCollide, pp.CanQuery, pp.CanTouch = false, false, false local prompt = Instance.new("ProximityPrompt") prompt.ObjectText = "STORM SHELTER" prompt.ActionText = "CLOSE DOOR" prompt.HoldDuration = 0 prompt.MaxActivationDistance = 14 prompt.RequiresLineOfSight = false prompt.Parent = pp prompt.Triggered:Connect(function() s.open = not s.open prompt.ActionText = s.open and "CLOSE DOOR" or "OPEN DOOR" end) -- sign local bb = Instance.new("BillboardGui") bb.Size = UDim2.fromOffset(130, 24) bb.StudsOffset = Vector3.new(0, 5, 0) bb.LightInfluence = 0 bb.MaxDistance = 700 bb.Adornee = roof bb.Parent = roof local tl = Instance.new("TextLabel") tl.Size = UDim2.fromScale(1, 1) tl.BackgroundColor3 = Color3.fromRGB(10, 10, 10) tl.BackgroundTransparency = 0.3 tl.TextColor3 = Color3.fromRGB(255, 200, 0) tl.Font = Enum.Font.SourceSansBold tl.TextSize = 14 tl.Text = "STORM SHELTER" tl.Parent = bb Instance.new("UICorner", tl) shelters[#shelters + 1] = s return s end -- ================================================================ -- PLACEMENT -- ================================================================ local ray = RaycastParams.new() ray.FilterType = Enum.RaycastFilterType.Exclude local function groundAt(x, z, refY) local list = {funnelFolder, shelterFolder} local rf, bf = workspace:FindFirstChild("RainAssets"), workspace:FindFirstChild("LightningAssets") if rf then list[#list + 1] = rf end if bf then list[#list + 1] = bf end if Player.Character then list[#list + 1] = Player.Character end ray.FilterDescendantsInstances = list local r = workspace:Raycast(Vector3.new(x, refY + 300, z), Vector3.new(0, -1000, 0), ray) return r and r.Position or Vector3.new(x, groundY, z) end -- doorway (+Z side) faces the center point local function spawnShelterAt(x, z, center) local gp = groundAt(x, z, center.Y) local away = Vector3.new(gp.X - center.X, 0, gp.Z - center.Z) if away.Magnitude < 0.1 then away = Vector3.new(0, 0, -1) end return buildShelter(CFrame.lookAt(gp, gp + away)) end local function spawnInFront() local center = getFocusPosition() local char = Player.Character local root = char and char:FindFirstChild("HumanoidRootPart") local base = root and root.Position or center local look if root then look = Vector3.new(root.CFrame.LookVector.X, 0, root.CFrame.LookVector.Z) else local cam = workspace.CurrentCamera look = cam and Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z) or Vector3.new(0, 0, -1) end if look.Magnitude < 0.05 then look = Vector3.new(0, 0, -1) end local p = base + look.Unit * 45 spawnShelterAt(p.X, p.Z, base) end local function clearShelters() for i = #shelters, 1, -1 do shelters[i].model:Destroy() shelters[i] = nil end end -- ================================================================ -- INSIDE CHECK + MUFFLE LOOP -- ================================================================ local function isInside(s, p) local l = s.cf:PointToObjectSpace(p) return math.abs(l.X) < W / 2 and l.Z > -D / 2 and l.Z < D / 2 + T * 0.5 and l.Y > -2 and l.Y < H + 3 end local inBlend, curClosed = 0, 0 local hud = Instance.new("ScreenGui") hud.Name = "ShelterHUD" hud.ResetOnSpawn = false hud.Parent = Player.PlayerGui local hudLabel = Instance.new("TextLabel") hudLabel.AnchorPoint = Vector2.new(0.5, 1) hudLabel.Position = UDim2.new(0.5, 0, 1, -60) hudLabel.Size = UDim2.fromOffset(240, 22) hudLabel.BackgroundColor3 = Color3.fromRGB(10, 10, 10) hudLabel.BackgroundTransparency = 0.3 hudLabel.TextColor3 = Color3.fromRGB(120, 255, 150) hudLabel.Font = Enum.Font.SourceSansBold hudLabel.TextSize = 14 hudLabel.Visible = false hudLabel.Parent = hud Instance.new("UICorner", hudLabel) RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) local char = Player.Character local root = char and char:FindFirstChild("HumanoidRootPart") local pos = root and root.Position or getFocusPosition() local inside for i = #shelters, 1, -1 do local s = shelters[i] if not s.model.Parent then table.remove(shelters, i) else local goal = s.open and 1 or 0 if s.alpha ~= goal then local step = SHELTER.DoorSpeed * dt if s.alpha < goal then s.alpha = math.min(s.alpha + step, goal) else s.alpha = math.max(s.alpha - step, goal) end setDoor(s) end if not inside and isInside(s, pos) then inside = s end end end local k = 1 - math.exp(-dt * SHELTER.Blend) inBlend += ((inside and 1 or 0) - inBlend) * k if inside then curClosed += ((1 - inside.alpha) - curClosed) * k end local c = curClosed local vol = SHELTER.OpenVolume + (SHELTER.ClosedVolume - SHELTER.OpenVolume) * c local high = SHELTER.OpenHigh + (SHELTER.ClosedHigh - SHELTER.OpenHigh) * c local mid = SHELTER.OpenMid + (SHELTER.ClosedMid - SHELTER.OpenMid) * c group.Volume = 1 + (vol - 1) * inBlend eq.HighGain = high * inBlend eq.MidGain = mid * inBlend eq.LowGain = SHELTER.BoostLow * inBlend hudLabel.Visible = inBlend > 0.5 if hudLabel.Visible then hudLabel.Text = (inside and inside.open or (not inside and curClosed < 0.5)) and "IN SHELTER - DOOR OPEN" or "IN SHELTER - SOUNDS MUFFLED" end end) -- ================================================================ -- GUI BUTTONS (added to your existing scrolling panel) -- ================================================================ local function addButtons() local sg = Player.PlayerGui:FindFirstChild("TornadoControls") local scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if not scroll then return end local function btn(text, color, order, fn) local b = Instance.new("TextButton") b.LayoutOrder = order b.Size = UDim2.new(1, -6, 0, 20) b.BackgroundColor3 = color b.Text = text b.TextColor3 = Color3.new(1, 1, 1) b.Font = Enum.Font.SourceSansBold b.TextSize = 11 b.Parent = scroll Instance.new("UICorner", b) b.MouseButton1Click:Connect(fn) end btn("SPAWN SHELTER", Color3.fromRGB(90, 90, 110), 110, spawnInFront) btn("CLEAR SHELTERS", Color3.fromRGB(110, 70, 70), 111, clearShelters) end addButtons() -- ================================================================ -- AUTO-BUILD A FEW AROUND YOU AT START -- ================================================================ task.spawn(function() local char = Player.Character or Player.CharacterAdded:Wait() char:WaitForChild("HumanoidRootPart", 10) task.wait(1.5) local center = getFocusPosition() for i = 1, SHELTER.Count do local a = (i / SHELTER.Count) * math.pi * 2 + math.random() * 0.8 local d = SHELTER.MinDist + math.random() * (SHELTER.MaxDist - SHELTER.MinDist) spawnShelterAt(center.X + math.cos(a) * d, center.Z + math.sin(a) * d, center) end end) end) -- ==================================================================== -- [[ TORNADO API + CAR DRIVER SHIELD for the vehicle garage ]] -- PASTE THIS AT THE VERY BOTTOM of your tornado script (after the -- STORM SHELTERS block). If you pasted the older version, replace it. -- Nothing else needs editing. -- -- 1) TornadoAPI: lets dominator_garage.lua read the live storm so a car -- is snatched when the wind at the car reaches its threshold. -- 2) Driver shield: the tornado's player-lift grabs anyone within ~2x the -- funnel radius and fights the car for control of your character. While -- you are driving (character attribute "InVehicle") it now leaves you -- alone, so you stay in the seat and ride with the car. -- Run the tornado script first, then the garage script. -- ==================================================================== if getgenv then getgenv().TornadoAPI = function() local widthScale = 0.4 + 0.6 * descendProgress return { contact = contact, -- 0..1, how far the funnel is on the ground peak = currentWindSpeedMPH * contact, -- peak wind mph at the funnel ef = currentEF, pos = liveStormPos, height = sm.Height, colR = columnRadius() * widthScale, bend = bendAt, } end end do local origUpdateVictims = updateVictims updateVictims = function(...) local char = Player.Character if char and char:GetAttribute("InVehicle") then local st = victims[Player] if st then clearPull(st, char:FindFirstChildOfClass("Humanoid")) victims[Player] = nil end cooldowns[Player] = timeElapsed + 2 -- keeps it from starting a new grab end return origUpdateVictims(...) end end -- ==================================================================== -- [[ UNANCHORED OBJECT SUCTION ]] -- PASTE THIS AT THE VERY BOTTOM of your tornado script (after the -- tornado_api_addon block). Nothing else needs editing. -- -- Why loose objects weren't being sucked in: -- * only parts inside a small box around the funnel were ever grabbed -- * at EF0-EF2 the pull was weaker than friction, so parts just sat there -- * parts the SERVER owns ignore forces from your client -- -- This adds a proper suction system: -- * grabs every unanchored object within a wide radius of the funnel -- * wind field drags them in, spins them and lifts them near the core -- * after a few seconds each one is thrown back out of the vortex -- * asks the engine to hand your client physics ownership of nearby parts -- * 3 new panel buttons: SUCK LOOSE on/off, SPAWN LOOSE PARTS (test blocks -- that always work), CLEAR LOOSE PARTS -- ==================================================================== task.spawn(function() local SUCK = { Enabled = true, BoostOwnership = true, -- request physics ownership of nearby loose parts RadiusMul = 2.0, -- capture radius = funnel ground radius x this MinRadius = 260, MaxRadius = 1500, MaxParts = 250, -- loose objects handled at once ScanEvery = 0.15, StepEvery = 0.05, Drag = 1.1, -- how hard the wind grabs a part MaxAccel = 900, -- lift (in gravities) near the core, by EF level Lift = {[0] = 0.8, [1] = 0.95, [2] = 1.1, [3] = 1.25, [4] = 1.4, [5] = 1.5}, -- heaviest assembly that can be sucked, by EF level (cars/heavy stuff use the old car logic) MaxMass = {[0] = 15, [1] = 40, [2] = 90, [3] = 160, [4] = 220, [5] = 249}, -- seconds in the vortex before being thrown out, by EF level Hold = {[0] = {14, 26}, [1] = {12, 24}, [2] = {10, 20}, [3] = {8, 16}, [4] = {6, 13}, [5] = {5, 10}}, EjectAccel = 520, EjectTime = 0.8, Cooldown = 12, -- seconds before a thrown part can be grabbed again SpinCap = 12, } local SKIP_FOLDERS = { "RainAssets", "LightningAssets", "DisasterPack", "TornadoTools", "RadarRoom", "TornadoSirens", "StormShelters", "LooseTestParts", } local tracked, count = {}, 0 local recent = setmetatable({}, {__mode = "k"}) local params = OverlapParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.MaxParts = 500 -- ================================================================ -- helpers -- ================================================================ local function groundRadius() return columnRadius() * (0.4 + 0.6 * descendProgress) end local function captureRadius() return math.clamp(groundRadius() * SUCK.RadiusMul, SUCK.MinRadius, SUCK.MaxRadius) end local function centerAt(pos) local h01 = math.clamp((pos.Y - liveStormPos.Y) / math.max(sm.Height, 1), 0, 1) local bx, bz = bendAt(h01) return Vector3.new(liveStormPos.X + bx, liveStormPos.Y, liveStormPos.Z + bz) end -- wind velocity (studs/s): spin + inflow + updraft local function fieldAt(pos, center, peak, core) local rx, rz = pos.X - center.X, pos.Z - center.Z local dist = math.max(math.sqrt(rx * rx + rz * rz), 1) local rdx, rdz = rx / dist, rz / dist local vt = (dist < core) and (dist / core) or (core / dist) ^ 0.75 local h01 = math.clamp((pos.Y - center.Y) / math.max(sm.Height, 1), 0, 1) local upK = math.clamp(1 - dist / (core * 1.7), 0, 1) ^ 0.7 return Vector3.new(-rdz, 0, rdx) * (vt * peak) + Vector3.new(-rdx, 0, -rdz) * (vt * peak * 0.45) + Vector3.new(0, upK * peak * 0.7 * (1 - 0.5 * h01), 0) end local function boost() pcall(function() sethiddenproperty(Player, "SimulationRadius", 1e9) end) pcall(function() sethiddenproperty(Player, "MaximumSimulationRadius", 1e9) end) pcall(function() Player.MaximumSimulationRadius = 1e9 end) end local function drop(root, st, ejected) if tracked[root] then tracked[root] = nil count -= 1 end if st.vf then st.vf:Destroy() end if st.att then st.att:Destroy() end for _, m in ipairs(st.markers) do if m.Parent then m:Destroy() end end recent[root] = timeElapsed + (ejected and SUCK.Cooldown or 3) end local function adopt(root) local att = Instance.new("Attachment") att.Name = "SuckAtt" att.Parent = root local vf = Instance.new("VectorForce") vf.Name = "SuckForce" vf.Attachment0 = att vf.RelativeTo = Enum.ActuatorRelativeTo.World vf.ApplyAtCenterOfMass = true vf.Force = Vector3.zero vf.Parent = root -- stop the old weak debris force from fighting this one: mark every part of the -- assembly so the main script skips it, and remove any force it already added local markers = {} local okc, connected = pcall(function() return root:GetConnectedParts(true) end) for _, q in ipairs(okc and connected or {root}) do local old = debrisTracked[q] if old then debrisTracked[q] = nil debrisCount -= 1 if old.vf then old.vf:Destroy() end if old.att and old.att.Parent then old.att:Destroy() end end if not q:FindFirstChild("TornadoForce") then local mk = Instance.new("BoolValue") mk.Name = "TornadoForce" mk.Parent = q markers[#markers + 1] = mk end end local hold = SUCK.Hold[currentEF] tracked[root] = { att = att, vf = vf, markers = markers, nextKick = timeElapsed + 1 + math.random() * 2, ejectAt = timeElapsed + hold[1] + math.random() * (hold[2] - hold[1]), } count += 1 end -- ================================================================ -- scan: find loose parts around the funnel -- ================================================================ local function scan() if count >= SUCK.MaxParts then return end local skip = {funnelFolder} for _, n in ipairs(SKIP_FOLDERS) do local f = workspace:FindFirstChild(n) if f then skip[#skip + 1] = f end end for _, plr in ipairs(Players:GetPlayers()) do if plr.Character then skip[#skip + 1] = plr.Character end end params.FilterDescendantsInstances = skip local H = math.max(sm.Height * descendProgress, 400) local R = captureRadius() local center = Vector3.new(liveStormPos.X, liveStormPos.Y + H / 2 - 40, liveStormPos.Z) local parts = workspace:GetPartBoundsInBox(CFrame.new(center), Vector3.new(R * 2, H + 80, R * 2), params) local now = timeElapsed local maxMass = SUCK.MaxMass[currentEF] local added = 0 for _, p in ipairs(parts) do if count >= SUCK.MaxParts or added >= 40 then break end if p:IsA("BasePart") and not p.Anchored and not p:IsA("Terrain") then local root = p.AssemblyRootPart if root and not root.Anchored and not tracked[root] and (recent[root] or 0) <= now and not carTracked[root] then local helper = (not root.CanCollide) and root.Transparency >= 0.95 if not helper then local mass = root.AssemblyMass if mass > 0 and mass <= maxMass and mass < CARS.HeavyMass and not isCarAssembly(root) and not isCharPart(root) then adopt(root) added += 1 end end end end end end -- ================================================================ -- step: apply the forces -- ================================================================ local function step() if count == 0 then return end local now = timeElapsed local g = workspace.Gravity local ef = currentEF local peak = math.max(currentWindSpeedMPH * contact, 40) local core = math.max(groundRadius() * 0.8, 60) local maxD = captureRadius() * 1.7 local liftG = SUCK.Lift[ef] local maxMass = SUCK.MaxMass[ef] for root, st in pairs(tracked) do if not root.Parent or root.Anchored or not st.vf.Parent or root.Position.Y < -500 then drop(root, st) continue end local pos = root.Position local c = centerAt(pos) local dx, dz = pos.X - c.X, pos.Z - c.Z local dist = math.sqrt(dx * dx + dz * dz) if dist > maxD then drop(root, st) continue end local mass = root.AssemblyMass if mass <= 0 then continue end local rad = dist > 0.5 and Vector3.new(dx / dist, 0, dz / dist) or Vector3.new(1, 0, 0) local tan = Vector3.new(-rad.Z, 0, rad.X) local accel if st.ejectEnd then if now < st.ejectEnd then accel = st.ejectVec + Vector3.new(0, g * 0.6, 0) else drop(root, st, true) continue end else local vel = root.AssemblyLinearVelocity local target = fieldAt(pos, c, peak, core) local near = math.clamp(1.4 - dist / core, 0, 1) local massK = 1 - 0.5 * math.clamp(mass / math.max(maxMass, 1), 0, 1) local lift = liftG * (0.55 + 0.45 * near) * massK accel = (target - vel) * SUCK.Drag + Vector3.new(0, g * lift, 0) if now >= st.nextKick then st.nextKick = now + 1.5 + math.random() * 2 root.AssemblyAngularVelocity += Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5) * 8 end if now >= st.ejectAt then st.ejectEnd = now + SUCK.EjectTime local d = rad * 0.8 + tan * 0.7 + Vector3.new(0, 0.5 + math.random() * 0.4, 0) st.ejectVec = d.Unit * SUCK.EjectAccel * (0.7 + math.random() * 0.6) end end if accel.Magnitude > SUCK.MaxAccel then accel = accel.Unit * SUCK.MaxAccel end st.vf.Force = accel * mass local av = root.AssemblyAngularVelocity if av.Magnitude > SUCK.SpinCap then root.AssemblyAngularVelocity = av.Unit * SUCK.SpinCap end end end -- ================================================================ -- test parts (created by YOUR client, so they always move) -- ================================================================ local function looseFolder() local f = workspace:FindFirstChild("LooseTestParts") if not f then f = Instance.new("Folder") f.Name = "LooseTestParts" f.Parent = workspace end return f end local function spawnLoose() local folder = looseFolder() local rp = RaycastParams.new() rp.FilterType = Enum.RaycastFilterType.Exclude local list = {funnelFolder, folder} if Player.Character then list[#list + 1] = Player.Character end rp.FilterDescendantsInstances = list local mats = {Enum.Material.Wood, Enum.Material.Metal, Enum.Material.Plastic, Enum.Material.Concrete} local R = math.max(groundRadius(), 100) for _ = 1, 40 do local a = math.random() * math.pi * 2 local d = R * (0.4 + 1.2 * math.random()) local x, z = liveStormPos.X + math.cos(a) * d, liveStormPos.Z + math.sin(a) * d local hit = workspace:Raycast(Vector3.new(x, liveStormPos.Y + 300, z), Vector3.new(0, -800, 0), rp) local y = (hit and hit.Position.Y or liveStormPos.Y) + 4 local p = Instance.new("Part") p.Name = "LoosePart" p.Size = Vector3.new(1 + math.random() * 4, 1 + math.random() * 3, 1 + math.random() * 5) p.Material = mats[math.random(#mats)] p.Color = Color3.fromHSV(math.random(), 0.25, 0.55 + math.random() * 0.4) p.Anchored = false p.CFrame = CFrame.new(x, y, z) * CFrame.Angles(math.random() * 6, math.random() * 6, math.random() * 6) p.Parent = folder end end local function clearLoose() local f = workspace:FindFirstChild("LooseTestParts") if f then f:ClearAllChildren() end end -- ================================================================ -- GUI BUTTONS (added to your scrolling control panel) -- ================================================================ task.spawn(function() local sg for _ = 1, 40 do sg = Player.PlayerGui:FindFirstChild("TornadoControls") if sg then break end task.wait(0.25) end local scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if not scroll then return end local function btn(text, color, order, fn) local b = Instance.new("TextButton") b.LayoutOrder = order b.Size = UDim2.new(1, -6, 0, 20) b.BackgroundColor3 = color b.Text = text b.TextColor3 = Color3.new(1, 1, 1) b.Font = Enum.Font.SourceSansBold b.TextSize = 11 b.Parent = scroll Instance.new("UICorner", b) b.MouseButton1Click:Connect(function() fn(b) end) return b end btn("SUCK LOOSE: " .. (SUCK.Enabled and "ON" or "OFF"), Color3.fromRGB(60, 120, 100), 120, function(b) SUCK.Enabled = not SUCK.Enabled b.Text = "SUCK LOOSE: " .. (SUCK.Enabled and "ON" or "OFF") end) btn("SPAWN LOOSE PARTS", Color3.fromRGB(120, 90, 50), 121, spawnLoose) btn("CLEAR LOOSE PARTS", Color3.fromRGB(110, 60, 60), 122, clearLoose) end) -- ================================================================ -- MAIN LOOP -- ================================================================ boost() local accScan, accStep, accBoost = 0, 0, 0 RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) accBoost += dt if SUCK.BoostOwnership and accBoost >= 1 then accBoost = 0 boost() end if not SUCK.Enabled or contact < 0.3 then if count > 0 then for root, st in pairs(tracked) do drop(root, st) end end return end accScan += dt accStep += dt if accScan >= SUCK.ScanEvery then accScan = 0 scan() end if accStep >= SUCK.StepEvery then accStep = 0 step() end end) end) -- ==================================================================== -- [[ UNANCHORED PART SUCTION - ADDON ]] -- Paste at the VERY BOTTOM of the tornado script. -- Makes every unanchored part get properly sucked, spun, lifted and thrown. -- ==================================================================== task.spawn(function() local SUCK = { Enabled = true, BoostOwnership = true, -- try to take physics ownership of nearby parts RadiusMul = 2.4, -- capture radius = ground funnel radius × this MinRadius = 280, MaxRadius = 1800, MaxParts = 280, ScanEvery = 0.12, StepEvery = 0.04, Drag = 1.35, -- how hard the wind grabs parts MaxAccel = 1100, -- lift in gravities (stronger near core) Lift = {[0]=0.95, [1]=1.1, [2]=1.25, [3]=1.4, [4]=1.55, [5]=1.7}, -- max mass that can be sucked (cars still use the old car logic) MaxMass = {[0]=20, [1]=55, [2]=110, [3]=180, [4]=230, [5]=249}, -- how long a part stays in the vortex before being thrown Hold = {[0]={12,22}, [1]={10,20}, [2]={8,16}, [3]={6,13}, [4]={5,11}, [5]={4,9}}, EjectAccel = 580, EjectTime = 0.75, Cooldown = 10, SpinCap = 14, } local SKIP = { "RainAssets","LightningAssets","DisasterPack","TornadoTools","RadarRoom", "TornadoSirens","StormShelters","LooseTestParts","TornadoAssets" } local tracked, count = {}, 0 local recent = setmetatable({}, {__mode = "k"}) local params = OverlapParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.MaxParts = 600 local function groundR() return columnRadius() * (0.4 + 0.6 * descendProgress) end local function captureR() return math.clamp(groundR() * SUCK.RadiusMul, SUCK.MinRadius, SUCK.MaxRadius) end local function centerAt(pos) local h01 = math.clamp((pos.Y - liveStormPos.Y) / math.max(sm.Height, 1), 0, 1) local bx, bz = bendAt(h01) return Vector3.new(liveStormPos.X + bx, liveStormPos.Y, liveStormPos.Z + bz) end -- realistic wind field (spin + inflow + updraft) local function fieldAt(pos, center, peak, core) local rx, rz = pos.X - center.X, pos.Z - center.Z local dist = math.max(math.sqrt(rx*rx + rz*rz), 1) local rdx, rdz = rx/dist, rz/dist local vt = (dist < core) and (dist/core) or (core/dist)^0.75 local h01 = math.clamp((pos.Y - center.Y) / math.max(sm.Height, 1), 0, 1) local upK = math.clamp(1 - dist/(core*1.65), 0, 1)^0.7 return Vector3.new(-rdz, 0, rdx) * (vt * peak) + Vector3.new(-rdx, 0, -rdz) * (vt * peak * 0.48) + Vector3.new(0, upK * peak * 0.75 * (1 - 0.45*h01), 0) end local function boost() pcall(function() sethiddenproperty(Player, "SimulationRadius", 1e9) end) pcall(function() sethiddenproperty(Player, "MaximumSimulationRadius", 1e9) end) pcall(function() Player.MaximumSimulationRadius = 1e9 end) end local function drop(root, st, ejected) if tracked[root] then tracked[root] = nil count -= 1 end if st.vf then st.vf:Destroy() end if st.att then st.att:Destroy() end for _, m in ipairs(st.markers) do if m.Parent then m:Destroy() end end recent[root] = timeElapsed + (ejected and SUCK.Cooldown or 2.5) end local function adopt(root) if tracked[root] or count >= SUCK.MaxParts then return end local att = Instance.new("Attachment") att.Name = "SuckAtt" att.Parent = root local vf = Instance.new("VectorForce") vf.Name = "SuckForce" vf.Attachment0 = att vf.RelativeTo = Enum.ActuatorRelativeTo.World vf.ApplyAtCenterOfMass = true vf.Force = Vector3.zero vf.Parent = root -- kill any old weak debris force so they don't fight local markers = {} local ok, connected = pcall(function() return root:GetConnectedParts(true) end) for _, q in ipairs(ok and connected or {root}) do local old = debrisTracked[q] if old then debrisTracked[q] = nil debrisCount -= 1 if old.vf then old.vf:Destroy() end if old.att and old.att.Parent then old.att:Destroy() end end -- marker so the main script skips this part if not q:FindFirstChild("TornadoForce") then local mk = Instance.new("BoolValue") mk.Name = "TornadoForce" mk.Parent = q markers[#markers + 1] = mk end end local hold = SUCK.Hold[currentEF] or SUCK.Hold[2] tracked[root] = { att = att, vf = vf, markers = markers, nextKick = timeElapsed + 0.8 + math.random()*1.5, ejectAt = timeElapsed + hold[1] + math.random()*(hold[2]-hold[1]), } count += 1 end local function scan() if count >= SUCK.MaxParts or contact < 0.25 then return end local skip = {funnelFolder} for _, n in ipairs(SKIP) do local f = workspace:FindFirstChild(n) if f then skip[#skip+1] = f end end for _, plr in ipairs(Players:GetPlayers()) do if plr.Character then skip[#skip+1] = plr.Character end end params.FilterDescendantsInstances = skip local H = math.max(sm.Height * descendProgress, 450) local R = captureR() local center = Vector3.new(liveStormPos.X, liveStormPos.Y + H*0.45, liveStormPos.Z) local parts = workspace:GetPartBoundsInBox(CFrame.new(center), Vector3.new(R*2, H+120, R*2), params) local now = timeElapsed local maxMass = SUCK.MaxMass[currentEF] or 100 local added = 0 for _, p in ipairs(parts) do if count >= SUCK.MaxParts or added >= 45 then break end if p:IsA("BasePart") and not p.Anchored and not p:IsA("Terrain") then local root = p.AssemblyRootPart if root and not root.Anchored and not tracked[root] and (recent[root] or 0) <= now and not carTracked[root] and not isCharPart(root) and not isCarAssembly(root) then local helper = (not root.CanCollide) and root.Transparency >= 0.95 if not helper then local mass = root.AssemblyMass if mass > 0.1 and mass <= maxMass and mass < CARS.HeavyMass then adopt(root) added += 1 end end end end end end local function step() if count == 0 then return end local now = timeElapsed local g = workspace.Gravity local peak = math.max(currentWindSpeedMPH * contact, 55) local core = math.max(groundR() * 0.75, 55) local maxD = captureR() * 1.65 local liftG = SUCK.Lift[currentEF] or 1.2 local maxMass = SUCK.MaxMass[currentEF] or 100 for root, st in pairs(tracked) do if not root.Parent or root.Anchored or not st.vf.Parent or root.Position.Y < -600 then drop(root, st) continue end local pos = root.Position local c = centerAt(pos) local dx, dz = pos.X - c.X, pos.Z - c.Z local dist = math.sqrt(dx*dx + dz*dz) if dist > maxD then drop(root, st) continue end local mass = root.AssemblyMass if mass <= 0 then continue end local rad = dist > 0.4 and Vector3.new(dx/dist, 0, dz/dist) or Vector3.new(1,0,0) local tan = Vector3.new(-rad.Z, 0, rad.X) local accel if st.ejectEnd then if now < st.ejectEnd then accel = st.ejectVec + Vector3.new(0, g*0.55, 0) else drop(root, st, true) continue end else local vel = root.AssemblyLinearVelocity local target = fieldAt(pos, c, peak, core) local near = math.clamp(1.45 - dist/core, 0, 1) local massK = 1 - 0.55 * math.clamp(mass / math.max(maxMass, 1), 0, 1) local lift = liftG * (0.5 + 0.5*near) * massK accel = (target - vel) * SUCK.Drag + Vector3.new(0, g * lift, 0) -- random kicks so parts tumble if now >= st.nextKick then st.nextKick = now + 1.2 + math.random()*2 root.AssemblyAngularVelocity += Vector3.new( (math.random()-0.5)*9, (math.random()-0.5)*9, (math.random()-0.5)*9 ) end -- time to eject if now >= st.ejectAt then st.ejectEnd = now + SUCK.EjectTime local d = (rad*0.75 + tan*0.75 + Vector3.new(0, 0.55 + math.random()*0.45, 0)).Unit st.ejectVec = d * SUCK.EjectAccel * (0.7 + math.random()*0.55) end end if accel.Magnitude > SUCK.MaxAccel then accel = accel.Unit * SUCK.MaxAccel end st.vf.Force = accel * mass local av = root.AssemblyAngularVelocity if av.Magnitude > SUCK.SpinCap then root.AssemblyAngularVelocity = av.Unit * SUCK.SpinCap end end end -- test parts (always client-owned) local function looseFolder() local f = workspace:FindFirstChild("LooseTestParts") if not f then f = Instance.new("Folder") f.Name = "LooseTestParts" f.Parent = workspace end return f end local function spawnLoose() local folder = looseFolder() local rp = RaycastParams.new() rp.FilterType = Enum.RaycastFilterType.Exclude local list = {funnelFolder, folder} if Player.Character then list[#list+1] = Player.Character end rp.FilterDescendantsInstances = list local mats = {Enum.Material.Wood, Enum.Material.Metal, Enum.Material.Plastic, Enum.Material.Concrete} local R = math.max(groundR(), 120) for _ = 1, 45 do local a = math.random()*math.pi*2 local d = R * (0.35 + 1.3*math.random()) local x = liveStormPos.X + math.cos(a)*d local z = liveStormPos.Z + math.sin(a)*d local hit = workspace:Raycast(Vector3.new(x, liveStormPos.Y+350, z), Vector3.new(0,-900,0), rp) local y = (hit and hit.Position.Y or liveStormPos.Y) + 3 + math.random()*4 local p = Instance.new("Part") p.Name = "LoosePart" p.Size = Vector3.new(1.2+math.random()*4.5, 0.8+math.random()*3.2, 1.2+math.random()*5) p.Material = mats[math.random(#mats)] p.Color = Color3.fromHSV(math.random(), 0.22, 0.5 + math.random()*0.45) p.Anchored = false p.CFrame = CFrame.new(x, y, z) * CFrame.Angles(math.random()*6, math.random()*6, math.random()*6) p.Parent = folder end end local function clearLoose() local f = workspace:FindFirstChild("LooseTestParts") if f then f:ClearAllChildren() end end -- GUI buttons task.spawn(function() local sg for _ = 1, 50 do sg = Player.PlayerGui:FindFirstChild("TornadoControls") if sg then break end task.wait(0.2) end local scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if not scroll then return end local function btn(text, color, order, fn) local b = Instance.new("TextButton") b.LayoutOrder = order b.Size = UDim2.new(1, -6, 0, 20) b.BackgroundColor3 = color b.Text = text b.TextColor3 = Color3.new(1,1,1) b.Font = Enum.Font.SourceSansBold b.TextSize = 11 b.Parent = scroll Instance.new("UICorner", b) b.MouseButton1Click:Connect(function() fn(b) end) return b end btn("SUCK LOOSE: ON", Color3.fromRGB(50, 130, 100), 130, function(b) SUCK.Enabled = not SUCK.Enabled b.Text = "SUCK LOOSE: " .. (SUCK.Enabled and "ON" or "OFF") end) btn("SPAWN LOOSE PARTS", Color3.fromRGB(130, 95, 45), 131, spawnLoose) btn("CLEAR LOOSE PARTS", Color3.fromRGB(120, 55, 55), 132, clearLoose) end) -- main loop boost() local accScan, accStep, accBoost = 0, 0, 0 RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) accBoost += dt if SUCK.BoostOwnership and accBoost >= 1.2 then accBoost = 0 boost() end if not SUCK.Enabled or contact < 0.25 then if count > 0 then for root, st in pairs(tracked) do drop(root, st) end end return end accScan += dt accStep += dt if accScan >= SUCK.ScanEvery then accScan = 0 scan() end if accStep >= SUCK.StepEvery then accStep = 0 step() end end) end) -- ==================================================================== -- [[ REALISTIC TORNADO PATH ]] -- PASTE AT THE VERY BOTTOM of the tornado script (same script, after the -- other addons). Nothing else needs editing. -- -- The stock script picks a brand new random direction every 10-20 seconds, -- so the tornado zig-zags. Real tornadoes hold a mostly straight track -- with the parent storm and bend gradually: -- * steady heading, set once (by default a close pass near the camera) -- * slow meander on top of it, with a turn-rate limit so it never snaps -- * a gentle left curve while it matures, then a right curve as it ropes out -- * ground speed that drifts faster and slower, with occasional near-stalls -- The GOTO CAMERA button still works: it takes over until it arrives, then -- the tornado eases back onto its natural track. -- ==================================================================== task.spawn(function() local RunService = game:GetService("RunService") if STORM_POS == nil or targetDirection == nil or MOVE_SPEED == nil or nextDirChange == nil then warn("[path] paste this at the VERY BOTTOM of the tornado script, same script") return end local P = { AimNearPlayer = true, -- true: track passes near the camera. false: follows the supercell heading MissMin = 150, -- how far (studs) the center of the track misses the camera by MissMax = 500, Meander = math.rad(16), -- slow wobble either side of the track MaxTurnRate = math.rad(1.6), -- degrees per second the heading can change LeftCurve = math.rad(20), -- left bend while maturing RightCurve = math.rad(35), -- right bend as it weakens MatureAfter = 150, -- seconds on the ground to finish the left bend RopeAfter = 240, -- seconds on the ground before the right bend starts RopeLength = 240, -- seconds the right bend takes SpeedVar = 0.5, -- how much the ground speed drifts (0 = constant) StallDip = 0.35, -- speed multiplier during a near-stall (1 = no stalls) } local PI, TAU = math.pi, math.pi * 2 local function angOf(v) return math.atan2(v.Z, v.X) end local function smooth(x) x = math.clamp(x, 0, 1) return x * x * (3 - 2 * x) end -- ---------- pick the base heading once ---------- local baseAng = angOf(SUPERCELL_HEADING) if P.AimNearPlayer then local cam = getFocusPosition() local to = Vector3.new(cam.X - STORM_POS.X, 0, cam.Z - STORM_POS.Z) local dist = to.Magnitude if dist > 50 then local miss = (P.MissMin + math.random() * (P.MissMax - P.MissMin)) * (math.random() < 0.5 and -1 or 1) baseAng = angOf(to) + math.asin(math.clamp(miss / dist, -0.9, 0.9)) end end local hdg = baseAng local seed = math.random() * 100 local baseSpeed = MOVE_SPEED local speedMul = 1 local contactTime = 0 local gotoUntil = nil targetDirection = Vector3.new(math.cos(hdg), 0, math.sin(hdg)) nextDirChange = math.huge -- Stepped runs before Heartbeat, so the main script moves the storm with our heading RunService.Stepped:Connect(function(_, dt) dt = math.min(dt, 0.1) local t = timeElapsed -- ---------- GOTO CAMERA button handling ---------- if nextDirChange ~= math.huge then if gotoUntil and t > gotoUntil then -- main script rolled a random turn after the goto ended: ignore it gotoUntil = nil nextDirChange = math.huge else gotoUntil = nextDirChange end end if gotoUntil and t > gotoUntil then gotoUntil = nil end if gotoUntil then hdg = angOf(targetDirection) -- stay in sync, main script is steering else -- ---------- natural track ---------- if contact > 0.6 then contactTime += dt end local life = 0 if contactTime > 0 then life = -P.LeftCurve * smooth(contactTime / P.MatureAfter) + (P.RightCurve + P.LeftCurve) * smooth((contactTime - P.RopeAfter) / P.RopeLength) end local meander = math.noise(t * 0.012, seed) * 2 * P.Meander local desired = baseAng + life + meander local diff = (desired - hdg + PI) % TAU - PI hdg += math.clamp(diff, -P.MaxTurnRate * dt, P.MaxTurnRate * dt) targetDirection = Vector3.new(math.cos(hdg), 0, math.sin(hdg)) nextDirChange = math.huge end -- ---------- ground speed ---------- local m = 1 + math.noise(t * 0.02, seed + 5) * 2 * P.SpeedVar local stallNoise = math.noise(t * 0.006, seed + 9) if stallNoise < -0.3 then m *= 1 - (1 - P.StallDip) * math.clamp((-stallNoise - 0.3) / 0.15, 0, 1) end m = math.clamp(m, 0.25, 1.7) speedMul += (m - speedMul) * (1 - math.exp(-dt * 0.5)) MOVE_SPEED = baseSpeed * speedMul end) end) -- ==================================================================== -- [[ HOUSE DESTRUCTION + SUCTION v4 (client side) ]] -- PASTE AT THE VERY BOTTOM of the tornado script (same script). -- This REPLACES v1, v2 and v3. Delete those, the two older suction addons and -- the stray "lastHouseStep" block. -- -- v4: suction is now three explicit VectorForce parts: SUCTION (inward pull), -- ORBIT (push around the core) and LIFT (up the funnel, eases off near the top). -- -- What changed in v3: ANY unanchored part in the workspace is sucked. -- * the per-EF mass cap is gone (at EF0 anything over 20 mass was ignored) -- * capture radius is 1800-4500 studs instead of ~300 at EF0 -- * far parts get a steady inward pull and lift, so friction can't pin them -- * scan checks nearby parts first so the closest always get a slot -- -- What changed from v1: -- * CARS and other heavy assemblies are now sucked in from a wide radius -- (before, only the thin funnel hitbox could grab them) -- * Parts the SERVER owns ignore forces from your client, which is why -- "unanchored parts in the game" never moved. Those parts are now moved -- by a local fallback: your client anchors them locally and flies them -- along the wind field itself (they land and can be grabbed again). -- Client side only, so other players don't see it. -- * House parts break in order: EF2 -> part 1, EF3 -> 1-2, EF4 -> 1-3, -- EF5 -> 1-4. -- ==================================================================== task.spawn(function() local RunService = game:GetService("RunService") local Players = game:GetService("Players") local Player = Players.LocalPlayer while not Player do task.wait() Player = Players.LocalPlayer end if columnRadius == nil or liveStormPos == nil or carTracked == nil or CARS == nil then warn("[suction] paste this at the VERY BOTTOM of the tornado script, same script") return end local S = { Enabled = true, BreakMul = 3.0, BreakMin = 300, BreakMax = 2000, CatchMul = 2.0, -- reach = funnel ground radius x this ... CatchMin = 350, -- ... but never less than this CatchMax = 1200, -- ... and never more than this (studs) EdgeFade = 0.85, -- how much the pull weakens toward the edge of the reach (0 = none) MaxParts = 600, MaxHeavy = 30, -- cars / heavy assemblies at once MaxHeavyMass = 60000, FarLift = 0.8, -- parts far from the funnel still get this much lift (gravities) FarPull = 45, -- studs/sec inward pull on light parts, at any distance -- VectorForce suction / orbit / lift (all scaled by mass, so heavy parts behave too) Pull = {[0]=60, [1]=80, [2]=100, [3]=130, [4]=160, [5]=200}, -- suction accel toward the core (studs/s^2) OrbitMul = 1.0, -- orbit speed = wind speed x this (falls off away from the core) OrbitMin = 25, OrbitMax = 260, OrbitGain = 1.6, -- how hard the orbit force chases the orbit speed LiftHeight = {[0]=0.15, [1]=0.25, [2]=0.4, [3]=0.55, [4]=0.7, [5]=0.85}, -- fraction of funnel height parts climb to HeavyScale = 0.6, -- cars / heavy parts get this share of the suction Damp = 0.08, -- sideways drag so nothing runs away DampY = 0.35, -- vertical drag, keeps hovering parts steady ScanEvery = 0.25, StepEvery = 0.04, Drag = 1.4, MaxAccel = 1200, MaxSpeed = 420, -- light parts: lift in gravities and heaviest mass that can be sucked, by EF Lift = {[0]=0.9, [1]=1.1, [2]=1.25, [3]=1.4, [4]=1.55, [5]=1.7}, LooseMass = {[0]=20, [1]=55, [2]=110, [3]=180, [4]=230, [5]=249}, Hold = {[0]={12,22}, [1]={10,20}, [2]={8,16}, [3]={6,13}, [4]={5,11}, [5]={4,9}}, -- cars / heavy: needs CARS.MinEF, lifts less at low EF HeavyDrag = 0.7, HeavyLift = {[0]=0, [1]=0.35, [2]=0.75, [3]=1.05, [4]=1.3, [5]=1.5}, HeavyHold = {[0]={10,18}, [1]={10,18}, [2]={9,16}, [3]={8,14}, [4]={6,12}, [5]={5,10}}, EjectAccel = 600, EjectTime = 0.8, Cooldown = 10, SpinCap = 14, BreaksPerScan = 60, UseLocalFallback = true, -- fly parts the server owns by moving them on your client } local SKIP = { "RainAssets", "LightningAssets", "DisasterPack", "TornadoTools", "RadarRoom", "TornadoSirens", "StormShelters", "TornadoAssets", "TornadoScars", } -- EF2 destroys part 1, EF3 destroys 1-2, EF4 destroys 1-3, EF5 destroys 1-4 local peakEF = 0 local function shouldBreak(n) if currentEF > peakEF then peakEF = currentEF end return n < peakEF end local tracked, count, heavyCount = {}, 0, 0 local recent = setmetatable({}, {__mode = "k"}) local kinLanded = setmetatable({}, {__mode = "k"}) -- roots we anchored locally after landing local params = OverlapParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.MaxParts = 1500 local kRay = RaycastParams.new() kRay.FilterType = Enum.RaycastFilterType.Exclude local function groundR() return columnRadius() * (0.4 + 0.6 * descendProgress) end local function centerAt(pos) local h01 = math.clamp((pos.Y - liveStormPos.Y) / math.max(sm.Height, 1), 0, 1) local bx, bz = bendAt(h01) return Vector3.new(liveStormPos.X + bx, liveStormPos.Y, liveStormPos.Z + bz) end local function fieldAt(pos, center, peak, core) local rx, rz = pos.X - center.X, pos.Z - center.Z local dist = math.max(math.sqrt(rx * rx + rz * rz), 1) local rdx, rdz = rx / dist, rz / dist local vt = (dist < core) and (dist / core) or (core / dist) ^ 0.75 local h01 = math.clamp((pos.Y - center.Y) / math.max(sm.Height, 1), 0, 1) local upK = math.clamp(1 - dist / (core * 1.65), 0, 1) ^ 0.7 return Vector3.new(-rdz, 0, rdx) * (vt * peak) + Vector3.new(-rdx, 0, -rdz) * (vt * peak * 0.5) + Vector3.new(0, upK * peak * 0.8 * (1 - 0.45 * h01), 0) end local function boost() pcall(function() sethiddenproperty(Player, "SimulationRadius", 1e9) end) pcall(function() sethiddenproperty(Player, "MaximumSimulationRadius", 1e9) end) pcall(function() Player.MaximumSimulationRadius = 1e9 end) if setsimulationradius then pcall(setsimulationradius, 1e9, 1e9) end end local function houseNum(p) local n = tonumber(p.Name) if n and n >= 1 and n <= 5 and n % 1 == 0 then return n end end -- ================================================================ -- tracking -- ================================================================ local function release(root, st, ejected) if tracked[root] then tracked[root] = nil count -= 1 if st.heavy then heavyCount -= 1 end end if st.vf then st.vf:Destroy() end if st.att then st.att:Destroy() end for _, m in ipairs(st.markers) do if m.Parent then m:Destroy() end end recent[root] = timeElapsed + (ejected and S.Cooldown or 2.5) end -- take over a part: stop forces from the physics engine and fly it ourselves local function convertKin(root, st) if st.kin then return end st.kin = true st.vel = root.AssemblyLinearVelocity st.av = root.AssemblyAngularVelocity st.lastT = timeElapsed if st.vf then st.vf:Destroy() st.vf = nil end if st.att then st.att:Destroy() st.att = nil end local ok, group = pcall(function() return root:GetConnectedParts(true) end) group = ok and group or {root} local filter = {funnelFolder} local below = 1 for _, q in ipairs(group) do filter[#filter + 1] = q local lowest = q.Position.Y - q.Size.Magnitude * 0.5 below = math.max(below, root.Position.Y - lowest) end for _, plr in ipairs(Players:GetPlayers()) do if plr.Character then filter[#filter + 1] = plr.Character end end st.filter = filter st.below = math.min(below, 60) st.gtick = 0 root.Anchored = true root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero end local function adopt(root, heavy, landed) if tracked[root] or count >= S.MaxParts then return end for _, c in ipairs(root:GetChildren()) do if c:IsA("VectorForce") and (c.Name == "HouseForce" or c.Name == "TornadoForce") then c:Destroy() end end local att = Instance.new("Attachment") att.Name = "SuckAtt" att.Parent = root local vf = Instance.new("VectorForce") vf.Name = "SuckForce" vf.Attachment0 = att vf.RelativeTo = Enum.ActuatorRelativeTo.World vf.ApplyAtCenterOfMass = true vf.Force = Vector3.zero vf.Parent = root local markers = {} local ok, connected = pcall(function() return root:GetConnectedParts(true) end) for _, q in ipairs(ok and connected or {root}) do local old = debrisTracked[q] if old then debrisTracked[q] = nil debrisCount -= 1 if old.vf then old.vf:Destroy() end if old.att and old.att.Parent then old.att:Destroy() end end if not q:FindFirstChild("TornadoForce") and not q:IsA("Terrain") then local mk = Instance.new("BoolValue") mk.Name = "TornadoForce" mk.Parent = q markers[#markers + 1] = mk end end local hold = (heavy and S.HeavyHold[currentEF] or S.Hold[currentEF]) or {8, 16} local now = timeElapsed local st = { att = att, vf = vf, markers = markers, heavy = heavy, nextKick = now + 0.5 + math.random() * 1.5, ejectAt = now + hold[1] + math.random() * (hold[2] - hold[1]), p0 = root.Position, checkAt = now + 0.8, } tracked[root] = st count += 1 if heavy then heavyCount += 1 end if S.UseLocalFallback then if landed then convertKin(root, st) elseif isnetworkowner then local okOwn, own = pcall(isnetworkowner, root) if okOwn and own == false then convertKin(root, st) end end end end local function breakPart(p) p.Anchored = false pcall(function() p:BreakJoints() end) for _, j in ipairs(p:GetJoints()) do pcall(function() j:Destroy() end) end p.CanCollide = true end -- ================================================================ -- scan -- ================================================================ local function tryAdopt(p, now) local root = p.AssemblyRootPart if not root or tracked[root] or (recent[root] or 0) > now or carTracked[root] or isCharPart(root) then return false end local landed = kinLanded[root] == true if root.Anchored and not landed then return false end if (not root.CanCollide) and root.Transparency >= 0.95 then return false end local isHouse = houseNum(root) ~= nil local mass = root.AssemblyMass local heavy = false if not isHouse then heavy = isCarAssembly(root) or mass >= CARS.HeavyMass if heavy then if currentEF < CARS.MinEF or heavyCount >= S.MaxHeavy or mass > S.MaxHeavyMass then return false end else if mass <= 0.01 then return false end -- no upper cap: any unanchored part under 250 mass end end adopt(root, heavy, landed) return true end local function scan() if contact < 0.25 then return end local skip = {funnelFolder} for _, n in ipairs(SKIP) do local f = workspace:FindFirstChild(n) if f then skip[#skip + 1] = f end end for _, plr in ipairs(Players:GetPlayers()) do if plr.Character then skip[#skip + 1] = plr.Character end end params.FilterDescendantsInstances = skip local H = math.max(sm.Height * descendProgress, 500) local gr = groundR() local R = math.max( math.clamp(gr * S.BreakMul, S.BreakMin, S.BreakMax), math.clamp(gr * S.CatchMul, S.CatchMin, S.CatchMax)) local Rn = math.clamp(gr * 1.4, 250, 700) local center = Vector3.new(liveStormPos.X, liveStormPos.Y + H * 0.45, liveStormPos.Z) local function query(r) return workspace:GetPartBoundsInBox(CFrame.new(center), Vector3.new(r * 2, H + 600, r * 2), params) end -- near parts first, so the closest ones always get a slot local near = query(Rn) local far = query(R) local parts = table.move(far, 1, #far, #near + 1, near) local breakR2 = math.clamp(gr * S.BreakMul, S.BreakMin, S.BreakMax) ^ 2 local catchR2 = math.clamp(gr * S.CatchMul, S.CatchMin, S.CatchMax) ^ 2 local now = timeElapsed local breaks, added, sounds = 0, 0, 3 for _, p in ipairs(parts) do if not p:IsA("BasePart") or p:IsA("Terrain") then continue end local dx, dz = p.Position.X - liveStormPos.X, p.Position.Z - liveStormPos.Z local d2 = dx * dx + dz * dz local hn = houseNum(p) if p.Anchored and hn and shouldBreak(hn) and d2 <= breakR2 and breaks < S.BreaksPerScan and count < S.MaxParts and not kinLanded[p] then breaks += 1 breakPart(p) if sounds > 0 and math.random(1, 4) == 1 then sounds -= 1 playBreakSound(p.Position) end adopt(p, false, false) elseif d2 <= catchR2 and added < 50 and count < S.MaxParts then if tryAdopt(p, now) then added += 1 end end end end -- ================================================================ -- step -- ================================================================ local function step(active) if count == 0 then return end local now = timeElapsed local g = workspace.Gravity local ef = currentEF local peak = math.max(currentWindSpeedMPH * contact, 55) local core = math.max(groundR() * 0.75, 55) local capR = math.clamp(groundR() * S.CatchMul, S.CatchMin, S.CatchMax) local maxD = capR * 1.3 for root, st in pairs(tracked) do if not root.Parent or root.Position.Y < -600 then release(root, st) continue end if not st.kin and (root.Anchored or not st.vf.Parent) then release(root, st) continue end -- tornado gone: dynamic parts are just let go, local ones finish their fall if not active then if st.kin then st.falling = true else release(root, st) continue end end local pos = root.Position local c = centerAt(pos) local dx, dz = pos.X - c.X, pos.Z - c.Z local dist = math.sqrt(dx * dx + dz * dz) if dist > maxD then if st.kin then st.falling = true else release(root, st) continue end end local rad = dist > 0.4 and Vector3.new(dx / dist, 0, dz / dist) or Vector3.new(1, 0, 0) local tan = Vector3.new(-rad.Z, 0, rad.X) local vel = st.kin and st.vel or root.AssemblyLinearVelocity -- parts that don't move even though a force is applied belong to the server: take them over if S.UseLocalFallback and not st.kin and not st.ejectEnd and now >= st.checkAt then st.checkAt = math.huge if (pos - st.p0).Magnitude < 2.5 and vel.Magnitude < 4 then convertKin(root, st) vel = st.vel end end local mass = math.max(root.AssemblyMass, 0.01) local accel = Vector3.zero if st.falling then accel = -vel * 0.05 elseif st.ejectEnd then if now < st.ejectEnd then accel = st.ejectVec + Vector3.new(0, g * 0.55, 0) else if st.kin then st.falling = true else release(root, st, true) continue end end end if not st.falling and not st.ejectEnd then local near = math.clamp(1.45 - dist / core, 0, 1) local h = pos.Y - c.Y local hMax = math.max(sm.Height * (S.LiftHeight[ef] or 0.5), 150) local scale = st.heavy and S.HeavyScale or 1 -- 1) SUCTION: VectorForce pull toward the core. It eases off right at the -- core so parts stay in the vortex instead of collapsing into the middle. local pullAcc = (S.Pull[ef] or 80) * (0.55 + 0.45 * near) * scale pullAcc *= math.clamp(dist / (core * 0.6), 0.15, 1) -- far parts at the edge of the reach are pulled much more gently local edge = math.clamp((dist - capR * 0.4) / (capR * 0.6), 0, 1) pullAcc *= 1 - S.EdgeFade * edge * edge * (3 - 2 * edge) local suction = -rad * pullAcc -- 2) ORBIT: push around the core until the part reaches an orbit speed that follows the wind local falloff = (dist < core) and (dist / core) or (core / dist) ^ 0.6 local orbitSpeed = math.clamp(peak * falloff * S.OrbitMul, S.OrbitMin, S.OrbitMax) local orbit = tan * ((orbitSpeed - vel:Dot(tan)) * S.OrbitGain) -- 3) LIFT: upward force that carries the part up the funnel and fades out -- near the top, so it hovers (EF3+) or never leaves the ground (EF0-1) local liftG if st.heavy then liftG = (S.HeavyLift[ef] or 1) * (0.5 + 0.5 * near) else liftG = math.max((S.Lift[ef] or 1.2) * (0.5 + 0.5 * near), S.FarLift) end local topK = math.clamp(1 - h / hMax, -0.25, 1) local lift = Vector3.new(0, g * liftG * topK, 0) accel = suction + orbit + lift - Vector3.new(vel.X * S.Damp, vel.Y * S.DampY, vel.Z * S.Damp) if now >= st.nextKick then st.nextKick = now + 1.2 + math.random() * 2 local k = st.heavy and 2 or 9 local kick = Vector3.new((math.random() - 0.5) * k, (math.random() - 0.5) * k, (math.random() - 0.5) * k) if st.kin then st.av += kick else root.AssemblyAngularVelocity += kick end end if now >= st.ejectAt then st.ejectEnd = now + S.EjectTime local d = (rad * 0.75 + tan * 0.75 + Vector3.new(0, 0.55 + math.random() * 0.45, 0)).Unit st.ejectVec = d * S.EjectAccel * (0.7 + math.random() * 0.55) end end if accel.Magnitude > S.MaxAccel then accel = accel.Unit * S.MaxAccel end if not st.kin then st.vf.Force = accel * mass local av = root.AssemblyAngularVelocity if av.Magnitude > S.SpinCap then root.AssemblyAngularVelocity = av.Unit * S.SpinCap end else -- local flight: integrate ourselves local kdt = math.min(now - st.lastT, 0.15) st.lastT = now if kdt > 0 then local v = st.vel + (accel + Vector3.new(0, -g, 0)) * kdt if v.Magnitude > S.MaxSpeed then v = v.Unit * S.MaxSpeed end local newPos = pos + v * kdt if st.av.Magnitude > S.SpinCap then st.av = st.av.Unit * S.SpinCap end st.gtick += 1 local landedNow = false if st.falling or st.gtick % 3 == 0 then kRay.FilterDescendantsInstances = st.filter local reach = st.below + 6 local hit = workspace:Raycast( newPos + Vector3.new(0, reach, 0), Vector3.new(0, -(reach + math.max(0, -v.Y * kdt * 3) + 2), 0), kRay) if hit and v.Y <= 0 then newPos = Vector3.new(newPos.X, hit.Position.Y + st.below, newPos.Z) v = Vector3.new(v.X * 0.6, 0, v.Z * 0.6) if st.falling and Vector3.new(v.X, 0, v.Z).Magnitude < 12 then landedNow = true end end end st.vel = v local cf = root.CFrame root.CFrame = CFrame.new(newPos) * cf.Rotation * CFrame.Angles(st.av.X * kdt, st.av.Y * kdt, st.av.Z * kdt) if landedNow or (st.falling and now - (st.fallStart or now) > 25) then kinLanded[root] = true release(root, st, true) elseif st.falling and not st.fallStart then st.fallStart = now end end end end end -- ================================================================ -- test parts + panel buttons -- ================================================================ local function spawnLoose() local folder = workspace:FindFirstChild("LooseTestParts") or Instance.new("Folder") folder.Name = "LooseTestParts" folder.Parent = workspace local rp = RaycastParams.new() rp.FilterType = Enum.RaycastFilterType.Exclude local list = {funnelFolder, folder} if Player.Character then list[#list + 1] = Player.Character end rp.FilterDescendantsInstances = list local mats = {Enum.Material.Wood, Enum.Material.Metal, Enum.Material.Plastic, Enum.Material.Concrete} local R = math.max(groundR(), 120) for _ = 1, 45 do local a = math.random() * math.pi * 2 local d = R * (0.35 + 1.3 * math.random()) local x, z = liveStormPos.X + math.cos(a) * d, liveStormPos.Z + math.sin(a) * d local hit = workspace:Raycast(Vector3.new(x, liveStormPos.Y + 350, z), Vector3.new(0, -900, 0), rp) local p = Instance.new("Part") p.Name = "LoosePart" p.Size = Vector3.new(1.2 + math.random() * 4.5, 0.8 + math.random() * 3.2, 1.2 + math.random() * 5) p.Material = mats[math.random(#mats)] p.Color = Color3.fromHSV(math.random(), 0.22, 0.5 + math.random() * 0.45) p.CFrame = CFrame.new(x, (hit and hit.Position.Y or liveStormPos.Y) + 3 + math.random() * 4, z) * CFrame.Angles(math.random() * 6, math.random() * 6, math.random() * 6) p.Parent = folder end end task.spawn(function() local sg for _ = 1, 50 do sg = Player.PlayerGui:FindFirstChild("TornadoControls") if sg then break end task.wait(0.2) end local scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if not scroll then return end local function btn(text, color, order, fn) local b = Instance.new("TextButton") b.LayoutOrder = order b.Size = UDim2.new(1, -6, 0, 20) b.BackgroundColor3 = color b.Text = text b.TextColor3 = Color3.new(1, 1, 1) b.Font = Enum.Font.SourceSansBold b.TextSize = 11 b.Parent = scroll Instance.new("UICorner", b) b.MouseButton1Click:Connect(function() fn(b) end) end btn("SUCTION: ON", Color3.fromRGB(50, 130, 100), 130, function(b) S.Enabled = not S.Enabled b.Text = "SUCTION: " .. (S.Enabled and "ON" or "OFF") end) btn("SPAWN LOOSE PARTS", Color3.fromRGB(130, 95, 45), 131, spawnLoose) btn("CLEAR LOOSE PARTS", Color3.fromRGB(120, 55, 55), 132, function() local f = workspace:FindFirstChild("LooseTestParts") if f then f:ClearAllChildren() end end) end) boost() local aScan, aStep, aBoost = 0, 0, 0 RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) aBoost += dt if aBoost >= 1.2 then aBoost = 0 boost() end local active = S.Enabled and contact >= 0.25 aScan += dt aStep += dt if active and aScan >= S.ScanEvery then aScan = 0 scan() end if aStep >= S.StepEvery then aStep = 0 step(active) end end) end) -- ==================================================================== -- [[ NIGHT DARKNESS + LIGHTNING THAT LIGHTS THE SUPERCELL ]] -- PASTE AT THE VERY BOTTOM of the tornado script (same script, after the -- other addons). Nothing else needs editing. -- -- Why it was never dark / lightning never lit the clouds: -- every cloud and funnel puff is a BillboardGui with LightInfluence = 0, -- which ignores the lighting completely, so they glow the same day or -- night. The sky, fog and ambient light also never changed with the time. -- -- What this does: -- * Reads Lighting.ClockTime. At night (after ~19:30, before ~04:30) the -- ambient light, fog, haze, sun rays and the inside-the-tornado fog all -- fade to dark, and every cloud / funnel / dust puff becomes affected -- by the lighting, so the whole storm goes dark with the world. -- * Every lightning strike is tracked. Clouds near the bolt (and the -- cloud base above it) brighten for the length of the flash and then -- fall back into darkness, so you see the supercell light up and -- disappear again, plus the normal whole-world flash from the main script. -- * Panel button NIGHT / DAY switches the time (0:00 / 12:00). -- ==================================================================== task.spawn(function() local RunService = game:GetService("RunService") local Lighting = game:GetService("Lighting") local Players = game:GetService("Players") local Player = Players.LocalPlayer while not Player do task.wait() Player = Players.LocalPlayer end if baseBrightness == nil or baseAmbient == nil or boltFolder == nil or clouds == nil or strikeLightning == nil or INSIDE == nil or funnel == nil then warn("[night] paste this at the VERY BOTTOM of the tornado script, same script") return end local CFG = { StartAtNight = false, -- true: sets the clock to midnight when the script starts Darkness = 1.0, -- 0..1, how dark night gets PuffLightInfl = 0.92, -- how much the clouds follow the lighting at night (1 = fully) -- lightning on the clouds GlowRadius = 3500, -- studs around the bolt that light up CloudGain = 5.0, -- how bright clouds get near a bolt CloudMax = 6.0, FunnelGain = 2.0, -- extra brightness on the funnel during any flash at night SheetStrength = 0.8, -- strength of the flashes inside the cloud (sheet lightning) -- night look NightBrightness = 0.12, NightAmbient = Color3.fromRGB(12, 14, 24), NightOutdoor = Color3.fromRGB(20, 24, 38), NightFog = Color3.fromRGB(8, 10, 16), NightAtm = Color3.fromRGB(26, 30, 44), NightAtmDecay = Color3.fromRGB(18, 20, 30), NightInsideFog = Color3.fromRGB(30, 34, 46), NightInsideTint = Color3.fromRGB(70, 78, 100), } -- remember the daytime look the main script set up local DAY = { Brightness = baseBrightness, Ambient = baseAmbient, Outdoor = baseOutdoor, Fog = baseFogColor, Atm = baseAtmColor, InsideFog = INSIDE.FogColor, InsideTint = INSIDE.Tint, } local atmosphere = Lighting:FindFirstChildOfClass("Atmosphere") local dayAtmDecay = atmosphere and atmosphere.Decay or Color3.fromRGB(170, 175, 185) local dayGlare = atmosphere and atmosphere.Glare or 0.2 local dayHaze = atmosphere and atmosphere.Haze or 0.3 local rays = Lighting:FindFirstChildOfClass("SunRays") local dayRays = rays and rays.Intensity or 0.15 if CFG.StartAtNight then Lighting.ClockTime = 0 end local function smooth(x) x = math.clamp(x, 0, 1) return x * x * (3 - 2 * x) end local function nightTarget() local ct = Lighting.ClockTime if ct >= 12 then return smooth((ct - 17.5) / 2) end return 1 - smooth((ct - 4.5) / 2) end -- ================================================================ -- every billboard that should follow the lighting at night -- ================================================================ local function allBillboards() local list = {} for _, d in ipairs(clouds) do if d.bb then list[#list + 1] = d.bb end end for _, d in ipairs(funnel) do if d.bb then list[#list + 1] = d.bb end end if DC and DC.list then for _, d in ipairs(DC.list) do if d.bb then list[#list + 1] = d.bb end end end if DUST and DUST.list then for _, d in ipairs(DUST.list) do if d.bb then list[#list + 1] = d.bb end end end if subVortexParticles then for _, d in ipairs(subVortexParticles) do if d.bb then list[#list + 1] = d.bb end end end return list end local billboards = allBillboards() -- does BillboardGui.Brightness exist here? local brightOk = false if clouds[1] and clouds[1].bb then brightOk = pcall(function() local b = clouds[1].bb.Brightness clouds[1].bb.Brightness = b end) end -- ================================================================ -- lightning tracking (wrap strikeLightning) -- ================================================================ local events = {} local seen = setmetatable({}, {__mode = "k"}) local origStrike = strikeLightning local function harvestBolts() for _, f in ipairs(boltFolder:GetChildren()) do if not seen[f] then seen[f] = true local top, ground local topY = -math.huge for _, p in ipairs(f:GetChildren()) do if p:IsA("BasePart") then local pos = p.Position if p:FindFirstChildOfClass("PointLight") then ground = pos - Vector3.new(0, 6, 0) end if pos.Y > topY then topY, top = pos.Y, pos end end end if top and ground then events[#events + 1] = { pts = {top, top:Lerp(ground, 0.25), top:Lerp(ground, 0.6), ground}, t0 = timeElapsed, str = 1, } end end end end local function sheetEvent() for _ = 1, 20 do local d = clouds[math.random(#clouds)] if d.p and d.p.Parent and supercellTime >= d.revealAt then local pos = d.p.Position if pos.Y > -5000 then events[#events + 1] = {pts = {pos}, t0 = timeElapsed, str = CFG.SheetStrength} return end end end end strikeLightning = function(sheet) origStrike(sheet) if sheet then sheetEvent() else harvestBolts() end end -- ================================================================ -- panel button -- ================================================================ task.spawn(function() local sg for _ = 1, 50 do sg = Player.PlayerGui:FindFirstChild("TornadoControls") if sg then break end task.wait(0.2) end local scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if not scroll then return end local b = Instance.new("TextButton") b.LayoutOrder = 150 b.Size = UDim2.new(1, -6, 0, 20) b.BackgroundColor3 = Color3.fromRGB(40, 45, 90) b.Text = "NIGHT / DAY" b.TextColor3 = Color3.new(1, 1, 1) b.Font = Enum.Font.SourceSansBold b.TextSize = 11 b.Parent = scroll Instance.new("UICorner", b) b.MouseButton1Click:Connect(function() Lighting.ClockTime = (nightTarget() > 0.5) and 12 or 0 end) end) -- ================================================================ -- main loop -- ================================================================ local nk = nightTarget() * CFG.Darkness local lastLI = -1 local nextLI = 0 local frame = 0 local boosted = false local R2 = CFG.GlowRadius * CFG.GlowRadius RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) frame += 1 local now = timeElapsed -- ---------- night amount ---------- nk += (nightTarget() * CFG.Darkness - nk) * (1 - math.exp(-dt * 1.5)) local k = nk -- the main script rebuilds the lighting from these every frame / flash baseBrightness = DAY.Brightness + (CFG.NightBrightness - DAY.Brightness) * k baseAmbient = DAY.Ambient:Lerp(CFG.NightAmbient, k) baseOutdoor = DAY.Outdoor:Lerp(CFG.NightOutdoor, k) baseFogColor = DAY.Fog:Lerp(CFG.NightFog, k) baseAtmColor = DAY.Atm:Lerp(CFG.NightAtm, k) INSIDE.FogColor = DAY.InsideFog:Lerp(CFG.NightInsideFog, k) INSIDE.Tint = DAY.InsideTint:Lerp(CFG.NightInsideTint, k) if lightningFlash == 0 and not flashApplied then Lighting.Brightness = baseBrightness Lighting.Ambient = baseAmbient Lighting.OutdoorAmbient = baseOutdoor end if atmosphere then atmosphere.Decay = dayAtmDecay:Lerp(CFG.NightAtmDecay, k) atmosphere.Glare = dayGlare * (1 - k) atmosphere.Haze = dayHaze * (1 - 0.5 * k) end if rays then rays.Intensity = dayRays * (1 - k) end -- ---------- clouds / funnel follow the lighting at night ---------- if now >= nextLI then nextLI = now + 0.2 if math.abs(k - lastLI) > 0.01 then lastLI = k local li = k * CFG.PuffLightInfl for _, bb in ipairs(billboards) do bb.LightInfluence = li end end end -- ---------- lightning lights the supercell ---------- local flash = lightningFlash if flash > 0.015 and #events > 0 and brightOk then for i = #events, 1, -1 do if now - events[i].t0 > 1.2 then table.remove(events, i) end end if frame % 2 == 0 then boosted = true local gain = CFG.CloudGain * (0.35 + 0.65 * k) for _, d in ipairs(clouds) do local p = d.p if p and d.bb and p.Parent then local pos = p.Position if pos.Y > -5000 then local boost = 0 for _, ev in ipairs(events) do local w = math.clamp(1 - (now - ev.t0) / 0.9, 0, 1) * ev.str if w > 0 then local dmin2 = math.huge for _, pt in ipairs(ev.pts) do local dx, dy, dz = pos.X - pt.X, pos.Y - pt.Y, pos.Z - pt.Z local d2 = dx * dx + dy * dy + dz * dz if d2 < dmin2 then dmin2 = d2 end end boost += w * flash * R2 / (R2 + dmin2) end end d.bb.Brightness = 1 + math.clamp(boost * gain, 0, CFG.CloudMax) end end end end elseif boosted then boosted = false for _, d in ipairs(clouds) do if d.bb then d.bb.Brightness = 1 end end end -- funnel, dust and debris puffs also flash at night if brightOk then local fb = 1 + flash * CFG.FunnelGain * k if flash > 0.015 or funnel[1].bb.Brightness ~= 1 then for _, d in ipairs(funnel) do d.bb.Brightness = fb end if DC and DC.list then for _, d in ipairs(DC.list) do d.bb.Brightness = fb end end if DUST and DUST.list then for _, d in ipairs(DUST.list) do d.bb.Brightness = fb end end end end end) end) -- ==================================================================== -- [[ RAIN ONLY UNDER THE SUPERCELL ]] -- PASTE AT THE VERY BOTTOM of the tornado script (same script, after the -- other addons). Nothing else needs editing. -- -- The stock script rains around you as soon as the cell is ~25% built, no -- matter where the cell actually is. This checks the real cloud puffs: rain -- only falls while there are cloud base puffs (shelf, wall, tower, flank, -- shaft) directly above you. Walk out from under the cell and it fades out, -- walk back under and it fades in. Rain volume and density follow how far -- under the cell you are. -- -- The RAIN: button still works as your on/off switch (it shows ON, OFF, or -- IDLE when it's on but you're not under the cell). -- ==================================================================== task.spawn(function() local RunService = game:GetService("RunService") local Players = game:GetService("Players") local Player = Players.LocalPlayer while not Player do task.wait() Player = Players.LocalPlayer end if RAIN_ENABLED == nil or RAIN_INTENSITY == nil or RAIN_VOLUME == nil or clouds == nil then warn("[rain] paste this at the VERY BOTTOM of the tornado script, same script") return end local CFG = { Enabled = true, FadeIn = 3, -- seconds for rain to fade in (stock script uses 8) Reach = 0.45, -- fraction of a puff's width that counts as "under" it Needed = 1.0, -- how much cloud coverage = full rain (lower = rains sooner) MinHeight = 150, -- a puff must be at least this far above the camera Smooth = 1.2, -- how quickly rain strength follows coverage } local BASE_KINDS = {shelf = true, wall = true, tower = true, flank = true, shaft = true} RAIN_FADE_IN = CFG.FadeIn local baseVolume = RAIN_VOLUME local userRain = RAIN_ENABLED local lastSet = RAIN_ENABLED local target, under = 0, 0 local nextCalc, nextText = 0, 0 local rainBtn local function findBtn() local sg = Player.PlayerGui:FindFirstChild("TornadoControls") local scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if not scroll then return nil end for _, b in ipairs(scroll:GetChildren()) do if b:IsA("TextButton") and string.sub(b.Text, 1, 5) == "RAIN:" then return b end end end RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) local now = timeElapsed -- the RAIN button flips RAIN_ENABLED; treat any change we didn't make as a toggle if RAIN_ENABLED ~= lastSet then userRain = not userRain end -- how much cloud is directly above the camera if now >= nextCalc then nextCalc = now + 0.25 local cam = getFocusPosition() local cov = 0 for _, d in ipairs(clouds) do if BASE_KINDS[d.kind] and d.p and d.bb and d.p.Parent then local pos = d.p.Position if pos.Y > cam.Y + CFG.MinHeight then local r = d.bb.Size.X.Scale * CFG.Reach local dx, dz = pos.X - cam.X, pos.Z - cam.Z local dist = math.sqrt(dx * dx + dz * dz) if dist < r and d.img.ImageTransparency < 0.92 then cov += 1 - dist / r end end end end target = math.clamp(cov / CFG.Needed, 0, 1) end under += (target - under) * (1 - math.exp(-dt * CFG.Smooth)) RAIN_INTENSITY = under RAIN_VOLUME = baseVolume * under RAIN_ENABLED = CFG.Enabled and userRain and under > 0.03 lastSet = RAIN_ENABLED -- keep the panel button honest if now >= nextText then nextText = now + 0.5 if not rainBtn or not rainBtn.Parent then rainBtn = findBtn() end if rainBtn then rainBtn.Text = userRain and (RAIN_ENABLED and "RAIN: ON" or "RAIN: IDLE") or "RAIN: OFF" end end end) end) -- ==================================================================== -- [[ DISTANT THUNDER SOUNDS ]] -- PASTE AT THE VERY BOTTOM of the tornado script (same script, after the -- other addons). Nothing else needs editing. -- -- Lightning that is far from you now plays the distant thunder sounds -- 118082536025477, 236328669, 167060366 -- instead of the close, cracking ones. Between NearDist and FarDist the two -- sets are mixed, so it changes gradually as you move away from the cell. -- Far thunder is also quieter, deeper, muffled and a little echoey. -- ==================================================================== task.spawn(function() local SoundService = game:GetService("SoundService") local Debris = game:GetService("Debris") local ContentProvider = game:GetService("ContentProvider") if playThunder == nil or THUNDER_SPEED == nil then warn("[far thunder] paste this at the VERY BOTTOM of the tornado script, same script") return end local FAR = { Ids = { "rbxassetid://118082536025477", "rbxassetid://236328669", "rbxassetid://167060366", }, NearDist = 1500, -- below this: always the normal close thunder FarDist = 3200, -- above this: always the distant thunder Volume = 3.4, -- loudness at the start of the far range MinVolume = 0.7, Falloff = 2400, -- studs of distance that remove one unit of volume Muffle = 150, -- higher = less treble cut with distance MaxMuffle = 28, -- dB of treble cut at most Echo = true, } -- warm the sounds up so the first rumble isn't late task.spawn(function() local tmp = {} for _, id in ipairs(FAR.Ids) do local s = Instance.new("Sound") s.SoundId = id tmp[#tmp + 1] = s end pcall(function() ContentProvider:PreloadAsync(tmp) end) for _, s in ipairs(tmp) do s:Destroy() end end) local function smooth(x) x = math.clamp(x, 0, 1) return x * x * (3 - 2 * x) end local function farThunder(dist, big) task.delay(dist / THUNDER_SPEED, function() local snd = Instance.new("Sound") snd.SoundId = FAR.Ids[math.random(#FAR.Ids)] snd.Volume = math.clamp(FAR.Volume - dist / FAR.Falloff, FAR.MinVolume, FAR.Volume) * (big and 1 or 0.75) snd.PlaybackSpeed = 0.85 + math.random() * 0.15 local eq = Instance.new("EqualizerSoundEffect") eq.HighGain = -math.clamp(dist / FAR.Muffle, 8, FAR.MaxMuffle) eq.MidGain = -3 eq.LowGain = 2 eq.Parent = snd if FAR.Echo then local rv = Instance.new("ReverbSoundEffect") rv.DecayTime = 3 rv.Density = 1 rv.Diffusion = 1 rv.DryLevel = -2 rv.WetLevel = -8 rv.Parent = snd end snd.Parent = SoundService snd:Play() Debris:AddItem(snd, 40) end) end local origThunder = playThunder playThunder = function(dist, big) local farK = smooth((dist - FAR.NearDist) / math.max(FAR.FarDist - FAR.NearDist, 1)) if farK > 0 and math.random() < farK then farThunder(dist, big) else origThunder(dist, big) end end end) -- ==================================================================== -- [[ CUSTOM SIREN: new model + plays 3 times ]] -- PASTE AT THE VERY BOTTOM of the tornado script (same script, after the -- other addons). This REPLACES tornado_siren_3x.lua, so delete that one. -- -- * Builds the siren from your drawing: brown pole, yellow driver box on a -- stepped base, a flared yellow horn on a thin arm, and the orange -- control box on the pole. The head turns while the siren sounds. -- * Sound 9073808042 plays Plays times (3) back to back, then stops. No -- fades. Each play is started by hand and waits for the previous one to -- end, so it doesn't depend on looping (that is what failed before). -- * Replaces the stock sirens: the stock ones are switched off here, and the -- auto siren (when the funnel starts to descend) and the SIREN button both -- use these. -- ==================================================================== if SIREN == nil or TOOLS == nil or getFocusPosition == nil then warn("[siren] paste this at the VERY BOTTOM of the tornado script, same script") else local RunService = game:GetService("RunService") local ContentProvider = game:GetService("ContentProvider") local CFG = { SoundId = "rbxassetid://9073808042", Plays = 3, Count = SIREN.Count or 3, MinDist = SIREN.MinDist or 250, MaxDist = SIREN.MaxDist or 600, Volume = SIREN.Volume or 4, RollOffMin = SIREN.RollOffMin or 150, RollOffMax = SIREN.RollOffMax or 6000, Reverb = true, PoleHeight = 36, ConeMeshId = "rbxassetid://8088306041", -- your cone mesh -- the mesh is assumed to point its tip UP. This turns it so the tip points at the -- yellow box and the wide end opens to the right. If it comes out backwards, use -- CFrame.Angles(0, 0, math.rad(-90)) instead. ConeRot = CFrame.Angles(0, 0, math.rad(90)), Mouth = true, -- dark opening on the horn Spin = true, -- the head turns while the siren sounds SpinSpeed = 2.2, -- radians per second AutoOnDescend = true, } -- switch the stock sirens off before they are built (they build a second after start) SIREN.Count = 0 SIREN.AutoOnDescend = false local YELLOW = Color3.fromRGB(238, 255, 0) local BROWN = Color3.fromRGB(75, 45, 18) local ORANGE = Color3.fromRGB(255, 128, 0) local folder = workspace:FindFirstChild("TornadoSirens") if not folder then folder = Instance.new("Folder") folder.Name = "TornadoSirens" folder.Parent = workspace end local sirens = {} local playing, autoDone = false, false local rayP = RaycastParams.new() rayP.FilterType = Enum.RaycastFilterType.Exclude local function groundAt(x, z) local list = {funnelFolder, folder} for _, n in ipairs({"RainAssets", "LightningAssets", "TornadoTools", "RadarRoom", "StormShelters", "DisasterPack"}) do local f = workspace:FindFirstChild(n) if f then list[#list + 1] = f end end if game.Players.LocalPlayer.Character then list[#list + 1] = game.Players.LocalPlayer.Character end rayP.FilterDescendantsInstances = list local r = workspace:Raycast(Vector3.new(x, groundY + 400, z), Vector3.new(0, -1200, 0), rayP) return r and r.Position or Vector3.new(x, groundY, z) end -- ================================================================ -- cone mesh (loaded once, cloned per siren; falls back to stacked discs) -- ================================================================ local coneTemplate local function loadCone() local AssetService = game:GetService("AssetService") local ok, mp = pcall(function() return AssetService:CreateMeshPartAsync(Content.fromUri(CFG.ConeMeshId)) end) if not ok or not mp then ok, mp = pcall(function() return AssetService:CreateMeshPartAsync(CFG.ConeMeshId) end) end if ok and mp then coneTemplate = mp else warn("[siren] cone mesh failed to load, using stacked discs instead") end end -- ================================================================ -- the siren model (from the drawing) -- ================================================================ local function buildSiren(pos) local H = CFG.PoleHeight local model = Instance.new("Model") model.Name = "TornadoSiren" model.Parent = folder local function mk(name, size, cf, color, solid) local p = Instance.new("Part") p.Name = name p.Size = size p.CFrame = cf p.Color = color p.Material = Enum.Material.SmoothPlastic p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth p.Anchored = true p.CanCollide = solid == true p.CanQuery = solid == true p.CanTouch = false p.CastShadow = solid == true p.Parent = model return p end -- pole + orange control box (these stay still) local pole = mk("Pole", Vector3.new(1.3, H + 0.5, 1.3), CFrame.new(pos + Vector3.new(0, H / 2 - 0.25, 0)), BROWN, true) mk("ControlBox", Vector3.new(2.6, 5.6, 2), CFrame.new(pos + Vector3.new(-1.6, H - 8.5, 0)), ORANGE, true) -- head (turns around the top of the pole) local pivot = CFrame.new(pos + Vector3.new(0, H, 0)) local defs = {} local function head(size, localCF, cyl, color) local part = mk("Head", size, pivot * localCF, color or YELLOW, false) if cyl then part.Shape = Enum.PartType.Cylinder end -- cylinders run along X defs[#defs + 1] = {part = part, cf = localCF} end head(Vector3.new(5, 5.3, 5), CFrame.new(-0.4, 4.6, 0)) -- driver box head(Vector3.new(4.6, 1, 4.6), CFrame.new(-0.2, 0.5, 0)) -- stepped base head(Vector3.new(3.6, 1, 3.6), CFrame.new(-0.2, 1.5, 0)) -- thin strut from the base up to the underside of the horn head(Vector3.new(3.6, 0.4, 0.4), CFrame.new(3.85, 1.7, 0) * CFrame.Angles(0, 0, math.rad(23))) -- cone horn: tip hidden inside the yellow box, wide end opens to the right local X0, LEN = 0.8, 6.9 local D1 = 7 -- diameter at the mouth local HORN_Y = 4.4 if coneTemplate then local c = coneTemplate:Clone() c.Name = "Head" c.Size = Vector3.new(D1, LEN, D1) -- the mesh stretches to this size local localCF = CFrame.new(X0 + LEN / 2, HORN_Y, 0) * CFG.ConeRot c.CFrame = pivot * localCF c.Color = YELLOW c.Material = Enum.Material.SmoothPlastic c.Anchored = true c.CanCollide, c.CanQuery, c.CanTouch, c.CastShadow = false, false, false, false c.Parent = model defs[#defs + 1] = {part = c, cf = localCF} else local SLICES, D0 = 18, 1.8 -- fallback: stacked round discs for i = 1, SLICES do local t = (i - 0.5) / SLICES local dia = D0 + (D1 - D0) * t ^ 1.5 local len = LEN / SLICES head(Vector3.new(len + 0.03, dia, dia), CFrame.new(X0 + (i - 0.5) * len, HORN_Y, 0), true) end end if CFG.Mouth then -- dark opening at the wide end head(Vector3.new(0.08, D1 * 0.82, D1 * 0.82), CFrame.new(X0 + LEN + 0.03, HORN_Y, 0), true, Color3.fromRGB(60, 55, 0)) end local snd = Instance.new("Sound") snd.Name = "SirenSound" snd.SoundId = CFG.SoundId snd.Looped = false snd.Volume = 0 snd.RollOffMinDistance = CFG.RollOffMin snd.RollOffMaxDistance = CFG.RollOffMax if CFG.Reverb then local rv = Instance.new("ReverbSoundEffect") rv.DecayTime = SIREN.ReverbDecay or 7 rv.Density = 1 rv.Diffusion = 1 rv.DryLevel = -3 rv.WetLevel = -12 rv.Parent = snd end snd.Parent = pole local s = { model = model, snd = snd, pivot = pivot, defs = defs, parts = {}, cfs = {}, ang = math.random() * 6, active = false, } for i, d in ipairs(defs) do s.parts[i] = d.part s.cfs[i] = d.part.CFrame end sirens[#sirens + 1] = s task.spawn(function() pcall(function() ContentProvider:PreloadAsync({snd}) end) end) return s end -- ================================================================ -- playback: start the sound by hand, wait for it to end, repeat -- ================================================================ local function startSirens() if playing or #sirens == 0 then return end playing = true task.spawn(function() local t0 = os.clock() for _, s in ipairs(sirens) do while not s.snd.IsLoaded and os.clock() - t0 < 10 do task.wait(0.1) end end if not sirens[1].snd.IsLoaded then warn("[siren] the siren audio did not load") playing = false return end for _ = 1, CFG.Plays do for _, s in ipairs(sirens) do s.snd.TimePosition = 0 s.snd.Volume = CFG.Volume s.active = true s.snd:Play() end local t1 = os.clock() local len = math.max(sirens[1].snd.TimeLength, 1) repeat task.wait(0.1) until (not sirens[1].snd.Playing and os.clock() - t1 > 0.5) or os.clock() - t1 > len + 3 end for _, s in ipairs(sirens) do s.snd:Stop() s.snd.Volume = 0 s.active = false end playing = false end) end TOOLS.siren = startSirens task.delay(2.5, function() TOOLS.siren = startSirens end) -- in case the stock one assigned later -- ================================================================ -- turn the head while sounding + auto start -- ================================================================ RunService.Heartbeat:Connect(function(dt) dt = math.min(dt, 0.1) if CFG.AutoOnDescend and not autoDone and (phase == "descending" or phase == "active") then autoDone = true startSirens() end if CFG.Spin then for _, s in ipairs(sirens) do if s.active then s.ang += dt * CFG.SpinSpeed local R = s.pivot * CFrame.Angles(0, s.ang, 0) for i, d in ipairs(s.defs) do s.cfs[i] = R * d.cf end workspace:BulkMoveTo(s.parts, s.cfs, Enum.BulkMoveMode.FireCFrameChanged) end end end end) -- ================================================================ -- place them around you -- ================================================================ task.spawn(function() task.wait(1.5) loadCone() local center = getFocusPosition() for i = 1, CFG.Count do local a = (i / CFG.Count) * math.pi * 2 + (math.random() - 0.5) * 0.6 local d = CFG.MinDist + math.random() * (CFG.MaxDist - CFG.MinDist) buildSiren(groundAt(center.X + math.cos(a) * d, center.Z + math.sin(a) * d)) end end) end -- ==================================================================== -- [[ NEIGHBORHOOD + POWER LINES ]] -- PASTE AT THE VERY BOTTOM of the tornado script (same script, after the -- other addons). Nothing else needs editing. -- -- Replaces the SPAWN HOUSES / CLEAR HOUSES panel buttons: -- SPAWN HOUSES builds a neighborhood in front of you: -- * a grid of asphalt roads with sidewalks and dashed center lines -- * your house model (HOUSE_MODEL_ID) lined up on lots facing the streets -- * bushes in the front yards and trees in the backyards / along the lots -- * power poles along the streets with wires strung between them -- CLEAR HOUSES removes all of it. -- -- Breaking order uses the same part names as your houses: -- bushes = "1" (break at EF2), trees = "2" (EF3), poles = "3" (EF4), -- house parts = random 1-5. -- -- Power lines are simulated rope physics, not decoration: -- * they sag and sway in the ambient wind and whip around near the tornado -- * strong wind snaps them: they spark, one end falls and dangles, the other -- end hangs on until its pole goes, then the wire blows around or gets -- lifted by the updraft -- * if a pole breaks or leans away, the wires on it snap too -- ==================================================================== task.spawn(function() local RunService = game:GetService("RunService") local Players = game:GetService("Players") local Debris = game:GetService("Debris") local Player = Players.LocalPlayer while not Player do task.wait() Player = Players.LocalPlayer end if loadAsset == nil or HOUSE_MODEL_ID == nil or calculateSpatialWindVector == nil or windSm == nil or clearHouses == nil or getFocusPosition == nil then warn("[neighborhood] paste this at the VERY BOTTOM of the tornado script, same script") return end local CFG = { -- layout BlocksX = 2, BlocksZ = 1, Block = 260, -- distance between road centers RoadWidth = 26, Sidewalk = 5, FrontYard = 10, -- grass between the sidewalk and the house HouseGap = 16, MaxPerSide = 3, FrontYawOffset = 0, -- degrees. If your houses face the wrong way, try 90, 180 or 270 AheadOfCamera = 300, Bushes = true, Trees = true, AutoBuild = false, -- true: build the neighborhood when the script starts -- power lines Poles = true, PoleHeight = 28, PoleSpacing = 80, WireSegments = 6, WireSag = 0.035, -- sag as a fraction of the span WireDrag = 0.9, -- how hard wind pushes the wire WindToStuds = 1.5, -- tornado wind (mph) to studs/sec BreakMPH = 85, -- wires start snapping above this wind speed BreakRate = 0.35, SimRange = 1800, -- wires farther than this from the camera aren't simulated } local ASPHALT = Color3.fromRGB(58, 58, 62) local CONCRETE = Color3.fromRGB(170, 170, 165) local PAINT = Color3.fromRGB(230, 200, 40) local WOOD = Color3.fromRGB(88, 62, 40) local WIRE = Color3.fromRGB(25, 25, 28) local TAU = math.pi * 2 local rng = Random.new() -- state local built = false local roadsFolder, propsFolder, wireFolder local wires, wireParts, wireCFs = {}, {}, {} local gy = 0 local rayP = RaycastParams.new() rayP.FilterType = Enum.RaycastFilterType.Exclude local function groundAt(x, z) local list = {funnelFolder} if Player.Character then list[#list + 1] = Player.Character end rayP.FilterDescendantsInstances = list local r = workspace:Raycast(Vector3.new(x, 1500, z), Vector3.new(0, -3000, 0), rayP) return r and r.Position.Y or groundY end local function mk(parent, name, size, cf, color, material, collide, shape) local p = Instance.new("Part") p.Name = name p.Size = size p.CFrame = cf p.Color = color p.Material = material or Enum.Material.SmoothPlastic p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth p.Anchored = true p.CanCollide = collide == true p.CanQuery = collide == true p.CanTouch = false p.CastShadow = false if shape then p.Shape = shape end p.Parent = parent return p end -- ================================================================ -- house template -- ================================================================ local template local function loadTemplate() local obj = loadAsset(HOUSE_MODEL_ID) if not obj then return nil end if obj:IsA("Model") then return obj end local m = Instance.new("Model") if obj:IsA("BasePart") then obj.Parent = m else for _, c in ipairs(obj:GetChildren()) do c.Parent = m end obj:Destroy() end return m end -- ================================================================ -- small props -- ================================================================ local function bush(pos) for _ = 1, rng:NextInteger(2, 3) do local r = 1.6 + rng:NextNumber() * 1.4 local off = Vector3.new(rng:NextNumber(-1.6, 1.6), r * 0.8, rng:NextNumber(-1.6, 1.6)) local col = Color3.fromRGB(rng:NextInteger(38, 62), rng:NextInteger(100, 142), rng:NextInteger(38, 62)) mk(propsFolder, "1", Vector3.new(r * 2, r * 2, r * 2), CFrame.new(pos + off), col, Enum.Material.Grass, false, Enum.PartType.Ball) end end local function tree(pos) local h = 8 + rng:NextNumber() * 3 mk(propsFolder, "2", Vector3.new(1.8, h, 1.8), CFrame.new(pos + Vector3.new(0, h / 2, 0)), Color3.fromRGB(95, 66, 42), Enum.Material.Wood, false) local d = 11 + rng:NextNumber() * 4 mk(propsFolder, "2", Vector3.new(d, d, d), CFrame.new(pos + Vector3.new(0, h + d * 0.35, 0)), Color3.fromRGB(46, 118, 56), Enum.Material.Grass, false, Enum.PartType.Ball) mk(propsFolder, "2", Vector3.new(d * 0.7, d * 0.7, d * 0.7), CFrame.new(pos + Vector3.new(rng:NextNumber(-2, 2), h + d * 0.75, rng:NextNumber(-2, 2))), Color3.fromRGB(54, 130, 62), Enum.Material.Grass, false, Enum.PartType.Ball) end -- ================================================================ -- wires -- ================================================================ local function sparks(pos) local p = Instance.new("Part") p.Anchored, p.CanCollide, p.CanQuery, p.CanTouch = true, false, false, false p.Transparency = 1 p.Size = Vector3.new(1, 1, 1) p.Position = pos p.Parent = wireFolder or workspace local e = Instance.new("ParticleEmitter") e.Texture = "rbxasset://textures/particles/sparkles_main.dds" e.Rate = 0 e.Lifetime = NumberRange.new(0.3, 0.8) e.Speed = NumberRange.new(15, 45) e.SpreadAngle = Vector2.new(180, 180) e.Acceleration = Vector3.new(0, -60, 0) e.Size = NumberSequence.new(1.3, 0) e.LightEmission = 1 e.Color = ColorSequence.new(Color3.fromRGB(255, 230, 150)) e.Parent = p e:Emit(22) local l = Instance.new("PointLight") l.Color = Color3.fromRGB(255, 235, 170) l.Range = 22 l.Brightness = 6 l.Parent = p task.delay(0.12, function() l:Destroy() end) Debris:AddItem(p, 2) end local function windAt(p, t) local base = 8 + 26 * supercellProgress local g1 = math.noise(p.X * 0.015, p.Z * 0.015, t * 0.6) local g2 = math.noise(p.Z * 0.02 + 7, p.X * 0.02, t * 0.9) local dir = targetDirection local v = dir * (base * (0.7 + 0.6 * g1)) + Vector3.new(-dir.Z, 0, dir.X) * (g2 * base * 0.6) local mph = 0 local dx, dz = p.X - liveStormPos.X, p.Z - liveStormPos.Z if contact > 0.02 and dx * dx + dz * dz < 9000000 then local vec, m = calculateSpatialWindVector(p, liveStormPos, windSm, contact) v += vec * CFG.WindToStuds mph = m end return v, mph end local function addWire(crossA, offA, crossB, offB) local SEG = CFG.WireSegments local a = crossA.CFrame * offA local b = crossB.CFrame * offB local span = (b - a).Magnitude local sag = span * CFG.WireSag local w = { crossA = crossA, crossB = crossB, offA = offA, offB = offB, N = SEG + 1, SEG = SEG, span = span, nodes = {}, prev = {}, rest = {}, broken = false, pinA = true, pinB = true, floorY = gy + 0.5, idx0 = #wireParts + 1, winds = {}, nextCheck = 0, } for k = 0, SEG do local t = k / SEG local p = a:Lerp(b, t) - Vector3.new(0, sag * 4 * t * (1 - t), 0) w.nodes[k + 1], w.prev[k + 1] = p, p end for k = 1, SEG do local len = (w.nodes[k + 1] - w.nodes[k]).Magnitude w.rest[k] = len local part = mk(wireFolder, "Wire", Vector3.new(0.2, 0.2, len + 0.15), CFrame.new(w.nodes[k]), WIRE) wireParts[#wireParts + 1] = part wireCFs[#wireCFs + 1] = CFrame.lookAt((w.nodes[k] + w.nodes[k + 1]) / 2, w.nodes[k + 1]) end wires[#wires + 1] = w end local function snap(w) if w.broken then return end w.broken = true local okA = w.crossA.Parent ~= nil and w.crossA.Anchored local okB = w.crossB.Parent ~= nil and w.crossB.Anchored if okA and okB then w.pinA = rng:NextNumber() < 0.5 w.pinB = not w.pinA else w.pinA, w.pinB = okA, okB end sparks(w.nodes[rng:NextInteger(2, w.N - 1)]) end local function stepWire(w, dt) local nodes, prev, N, SEG = w.nodes, w.prev, w.N, w.SEG local g = workspace.Gravity local pa = w.pinA and (w.crossA.CFrame * w.offA) or nil local pb = w.pinB and (w.crossB.CFrame * w.offB) or nil for i = 1, N do if i == 1 and pa then nodes[1], prev[1] = pa, pa elseif i == N and pb then nodes[N], prev[N] = pb, pb else local p, q = nodes[i], prev[i] local v = (p - q) / dt local acc = (w.winds[i] - v) * CFG.WireDrag + Vector3.new(0, -g, 0) local np = p + (p - q) * 0.99 + acc * dt * dt if np.Y < w.floorY then np = Vector3.new(np.X, w.floorY, np.Z) prev[i] = Vector3.new(np.X - (np.X - p.X) * 0.5, np.Y, np.Z - (np.Z - p.Z) * 0.5) else prev[i] = p end nodes[i] = np end end for _ = 1, 4 do for i = 1, SEG do local wa = ((i == 1 and pa) and 0 or 1) local wb = ((i + 1 == N and pb) and 0 or 1) local sum = wa + wb if sum > 0 then local d = nodes[i + 1] - nodes[i] local len = d.Magnitude if len > 1e-4 then local corr = d * ((len - w.rest[i]) / len) / sum nodes[i] = nodes[i] + corr * wa nodes[i + 1] = nodes[i + 1] - corr * wb end end end if pa then nodes[1] = pa end if pb then nodes[N] = pb end end for i = 1, N do if nodes[i].Y < w.floorY then nodes[i] = Vector3.new(nodes[i].X, w.floorY, nodes[i].Z) end end end local acc = 0 RunService.Heartbeat:Connect(function(dt) if not built or #wires == 0 then return end dt = math.min(dt, 0.1) local now = timeElapsed local cam = getFocusPosition() acc += dt local steps = math.min(math.floor(acc / (1 / 60)), 3) acc -= steps * (1 / 60) local moved = false for _, w in ipairs(wires) do local mid = w.nodes[math.ceil(w.N / 2)] if (mid - cam).Magnitude < CFG.SimRange then -- are the poles still there? local okA = w.crossA.Parent ~= nil and w.crossA.Anchored local okB = w.crossB.Parent ~= nil and w.crossB.Anchored if not w.broken then if not okA or not okB then snap(w) else local a, b = w.crossA.CFrame * w.offA, w.crossB.CFrame * w.offB if (a - b).Magnitude > w.span * 1.25 then snap(w) end end else if w.pinA and not okA then w.pinA = false end if w.pinB and not okB then w.pinB = false end end -- wind on every node local maxMph = 0 for i = 1, w.N do local v, m = windAt(w.nodes[i], now) w.winds[i] = v if m > maxMph then maxMph = m end end -- strong wind snaps the wire if not w.broken and maxMph > CFG.BreakMPH and now >= w.nextCheck then w.nextCheck = now + 0.2 if rng:NextNumber() < 0.2 * CFG.BreakRate * (maxMph / CFG.BreakMPH) * 3 then snap(w) end end for _ = 1, steps do stepWire(w, 1 / 60) end for k = 1, w.SEG do local a, b = w.nodes[k], w.nodes[k + 1] if (b - a).Magnitude < 1e-3 then b = a + Vector3.new(0, 0, 0.01) end wireCFs[w.idx0 + k - 1] = CFrame.lookAt((a + b) / 2, b) end moved = true end end if moved then workspace:BulkMoveTo(wireParts, wireCFs, Enum.BulkMoveMode.FireCFrameChanged) end end) -- ================================================================ -- build / clear -- ================================================================ local function clearAll() built = false wires, wireParts, wireCFs = {}, {}, {} for _, f in ipairs({roadsFolder, propsFolder, wireFolder}) do if f then f:Destroy() end end roadsFolder, propsFolder, wireFolder = nil, nil, nil clearHouses() end local function buildNeighborhood() clearAll() built = false roadsFolder = Instance.new("Folder") roadsFolder.Name = "NeighborhoodRoads" roadsFolder.Parent = workspace propsFolder = Instance.new("Folder") propsFolder.Name = "NeighborhoodProps" propsFolder.Parent = workspace wireFolder = Instance.new("Folder") wireFolder.Name = "NeighborhoodWires" wireFolder.Parent = workspace local R, SW = CFG.RoadWidth, CFG.Sidewalk local BX, BZ, BLOCK = CFG.BlocksX, CFG.BlocksZ, CFG.Block -- center ahead of the camera local cam = workspace.CurrentCamera local look = cam and Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z) or Vector3.new(0, 0, 1) if look.Magnitude < 0.01 then look = Vector3.new(0, 0, 1) end local focus = getFocusPosition() local C = focus + look.Unit * CFG.AheadOfCamera gy = groundAt(C.X, C.Z) local xs, zs = {}, {} for i = 0, BX do xs[#xs + 1] = C.X - BX * BLOCK / 2 + i * BLOCK end for j = 0, BZ do zs[#zs + 1] = C.Z - BZ * BLOCK / 2 + j * BLOCK end local xMin, xMax, zMin, zMax = xs[1], xs[#xs], zs[1], zs[#zs] -- ---------- roads ---------- for _, zc in ipairs(zs) do -- streets running along X local len = (xMax - xMin) + R mk(roadsFolder, "Road", Vector3.new(len, 0.4, R), CFrame.new((xMin + xMax) / 2, gy + 0.2, zc), ASPHALT, Enum.Material.Asphalt, true) end for _, xc in ipairs(xs) do -- streets running along Z (slightly thicker so intersections are clean) local len = (zMax - zMin) + R mk(roadsFolder, "Road", Vector3.new(R, 0.42, len), CFrame.new(xc, gy + 0.21, (zMin + zMax) / 2), ASPHALT, Enum.Material.Asphalt, true) end -- sidewalks between intersections + dashed center lines for _, zc in ipairs(zs) do for i = 1, #xs - 1 do local a, b = xs[i] + R / 2, xs[i + 1] - R / 2 for _, side in ipairs({-1, 1}) do mk(roadsFolder, "Sidewalk", Vector3.new(b - a, 0.6, SW), CFrame.new((a + b) / 2, gy + 0.3, zc + side * (R / 2 + SW / 2)), CONCRETE, Enum.Material.Concrete, true) end local x = a + 6 while x < b - 6 do mk(roadsFolder, "Line", Vector3.new(8, 0.05, 0.7), CFrame.new(x, gy + 0.43, zc), PAINT) x += 18 end end end for _, xc in ipairs(xs) do for j = 1, #zs - 1 do local a, b = zs[j] + R / 2, zs[j + 1] - R / 2 for _, side in ipairs({-1, 1}) do mk(roadsFolder, "Sidewalk", Vector3.new(SW, 0.6, b - a), CFrame.new(xc + side * (R / 2 + SW / 2), gy + 0.3, (a + b) / 2), CONCRETE, Enum.Material.Concrete, true) end local z = a + 6 while z < b - 6 do mk(roadsFolder, "Line", Vector3.new(0.7, 0.05, 8), CFrame.new(xc, gy + 0.45, z), PAINT) z += 18 end end end -- ---------- houses, bushes, trees ---------- template = template or loadTemplate() if not template then warn("[neighborhood] could not load the house model, building roads and power lines only") end local width, depth = 34, 30 if template then local ext = template:GetExtentsSize() width, depth = ext.X, ext.Z if CFG.FrontYawOffset % 180 ~= 0 then width, depth = depth, width end end local FY = CFG.FrontYard + SW local margin = FY + depth + 8 local houseCount = 0 local function placeHouse(pos, dir) if template then local m = template:Clone() m.Name = "SpawnedHouse" m.Parent = workspace m:PivotTo(CFrame.lookAt(pos, pos + dir) * CFrame.Angles(0, math.rad(CFG.FrontYawOffset), 0)) local bb, size = m:GetBoundingBox() m:PivotTo(m:GetPivot() + Vector3.new( pos.X - bb.Position.X, (gy + 0.6) - (bb.Position.Y - size.Y / 2), pos.Z - bb.Position.Z)) for _, p in ipairs(m:GetDescendants()) do if p:IsA("BasePart") then p.Name = tostring(rng:NextInteger(1, 5)) p.Anchored = true end end houseCount += 1 if houseCount % 3 == 0 then task.wait() end end if CFG.Bushes then local lat = Vector3.new(dir.Z, 0, -dir.X) local front = pos + dir * (depth / 2 + 2.5) bush(Vector3.new(front.X, gy, front.Z) + lat * (width * 0.38)) bush(Vector3.new(front.X, gy, front.Z) - lat * (width * 0.38)) bush(Vector3.new(front.X, gy, front.Z) + lat * rng:NextNumber(-width * 0.15, width * 0.15) + dir * 3) end end for i = 1, BX do for j = 1, BZ do local x1, x2 = xs[i] + R / 2 + SW * 0, xs[i + 1] - R / 2 local z1, z2 = zs[j] + R / 2, zs[j + 1] - R / 2 local sides = { {fixed = z2 - FY - depth / 2, lo = x1, hi = x2, alongX = true, dir = Vector3.new(0, 0, 1)}, {fixed = z1 + FY + depth / 2, lo = x1, hi = x2, alongX = true, dir = Vector3.new(0, 0, -1)}, {fixed = x2 - FY - depth / 2, lo = z1, hi = z2, alongX = false, dir = Vector3.new(1, 0, 0)}, {fixed = x1 + FY + depth / 2, lo = z1, hi = z2, alongX = false, dir = Vector3.new(-1, 0, 0)}, } for _, s in ipairs(sides) do local avail = (s.hi - s.lo) - 2 * margin local n = math.clamp(math.floor((avail + CFG.HouseGap) / (width + CFG.HouseGap)), 1, CFG.MaxPerSide) for k = 1, n do local c = s.lo + margin + (k - 0.5) * avail / n local pos = s.alongX and Vector3.new(c, gy, s.fixed) or Vector3.new(s.fixed, gy, c) placeHouse(pos, s.dir) end end if CFG.Trees then for _ = 1, 3 do tree(Vector3.new( rng:NextNumber(x1 + margin, x2 - margin), gy, rng:NextNumber(z1 + margin, z2 - margin))) end end end end -- ---------- power poles + wires ---------- if CFG.Poles then local H = CFG.PoleHeight local offset = R / 2 + SW + 2 local function polesAlong(lo, hi, crossings) local zoneHalf = R / 2 + 4 local pts = {} local p = lo + 8 while p <= hi - 8 do pts[#pts + 1] = p p += CFG.PoleSpacing end for _, c in ipairs(crossings) do pts[#pts + 1] = c - zoneHalf pts[#pts + 1] = c + zoneHalf end table.sort(pts) local out = {} for _, v in ipairs(pts) do local inside = false for _, c in ipairs(crossings) do if v > c - zoneHalf + 0.5 and v < c + zoneHalf - 0.5 then inside = true end end if not inside and v > lo and v < hi and (#out == 0 or v - out[#out] > 25) then out[#out + 1] = v end end return out end local function buildLine(positions, horizontal, fixed) local list = {} for _, v in ipairs(positions) do local pos = horizontal and Vector3.new(v, gy, fixed) or Vector3.new(fixed, gy, v) local pole = mk(propsFolder, "3", Vector3.new(1.4, H, 1.4), CFrame.new(pos + Vector3.new(0, H / 2 - 0.3, 0)), WOOD, Enum.Material.Wood, true) local csize = horizontal and Vector3.new(0.7, 0.7, 6) or Vector3.new(6, 0.7, 0.7) local cross = mk(propsFolder, "3", csize, CFrame.new(pos + Vector3.new(0, H - 1.5, 0)), WOOD, Enum.Material.Wood, false) list[#list + 1] = {pole = pole, cross = cross} end for k = 1, #list - 1 do for _, side in ipairs({-1, 1}) do local off = horizontal and Vector3.new(0, 0.8, side * 2.4) or Vector3.new(side * 2.4, 0.8, 0) addWire(list[k].cross, off, list[k + 1].cross, off) end end end for _, zc in ipairs(zs) do buildLine(polesAlong(xMin - R / 2, xMax + R / 2, xs), true, zc - offset) end for _, xc in ipairs(xs) do buildLine(polesAlong(zMin - R / 2, zMax + R / 2, zs), false, xc - offset) end end built = true end -- ================================================================ -- panel buttons (replace the old SPAWN HOUSES / CLEAR HOUSES) -- ================================================================ task.spawn(function() local scroll for _ = 1, 50 do local sg = Player.PlayerGui:FindFirstChild("TornadoControls") scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if scroll then break end task.wait(0.2) end if not scroll then return end local function replace(text, fn) for _, b in ipairs(scroll:GetChildren()) do if b:IsA("TextButton") and b.Text == text then local nb = b:Clone() nb.Parent = scroll b:Destroy() nb.MouseButton1Click:Connect(function() task.spawn(fn) end) return end end end replace("SPAWN HOUSES", buildNeighborhood) replace("CLEAR HOUSES", clearAll) replace("CLEAR ALL", clearAll) end) if CFG.AutoBuild then task.wait(2) buildNeighborhood() end end) -- ==================================================================== -- [[ BETTER MULTI-VORTEX ]] -- PASTE AT THE VERY BOTTOM of the tornado script (same script, after the -- other addons). Nothing else needs editing. -- -- The stock multi-vortex is a few loose grey blobs bobbing around the -- funnel. This replaces it with proper suction vortices: -- * each one is a thin funnel: narrow at the ground, flaring toward the top, -- spinning fast, leaning with the main tornado plus a little of its own -- * they orbit the main funnel in the same direction it spins, drifting in -- and out like real sub-vortices -- * each has a life cycle: it forms, matures, ropes out (thins and shrinks) -- and a new one forms later, so they come and go -- * a swirling dust cloud kicks up at the base of each -- * shaded like the main funnel (lit side / dark side, lightning flashes) and -- dark at night with the rest of the storm -- The MULTI-VORTEX button is replaced by one for this version. -- ==================================================================== task.spawn(function() local RunService = game:GetService("RunService") local Lighting = game:GetService("Lighting") local Players = game:GetService("Players") local Player = Players.LocalPlayer while not Player do task.wait() Player = Players.LocalPlayer end if MULTI_VORTEX_ENABLED == nil or createP == nil or funnelRadius == nil or tint == nil or bendAt == nil or funnelFolder == nil or DUST_COLOR == nil or PARKED == nil then warn("[multi-vortex] paste this at the VERY BOTTOM of the tornado script, same script") return end local CFG = { Enabled = MULTI_VORTEX_ENABLED, -- starts on if your script had it on; use the panel button after Count = 3, -- vortices at once Particles = math.max(24, math.floor(70 * QUALITY)), -- per vortex DustPuffs = math.max(6, math.floor(14 * QUALITY)), -- per vortex HeightFrac = 0.45, -- height as a fraction of the main funnel MinHeight = 120, MaxHeight = 650, TopRadius = 0.28, -- top radius as a fraction of the main funnel's ground radius MinTop = 16, MaxTop = 75, BottomRadius = 3.5, SpinDegPerSec = 130, OrbitSpeed = 0.2, -- radians per second around the main funnel GrowTime = {5, 8}, LifeTime = {10, 25}, RopeTime = {5, 9}, GapTime = {2, 9}, NightInfl = 0.92, } MULTI_VORTEX_ENABLED = false -- switch the stock blobs off, this addon runs the vortices local rng = Random.new() local TAU = math.pi * 2 local function smooth(x) x = math.clamp(x, 0, 1) return x * x * (3 - 2 * x) end -- ================================================================ -- build the particle pools -- ================================================================ local allParts, allCFs, allBB = {}, {}, {} local vortices = {} for i = 1, CFG.Count do local v = { orbit = (i / CFG.Count) * TAU + rng:NextNumber() * 0.8, rho = 0.8 + rng:NextNumber() * 0.5, omega = CFG.OrbitSpeed * (0.8 + rng:NextNumber() * 0.5), seed = rng:NextNumber() * 100, sizeMul = 0.8 + rng:NextNumber() * 0.5, state = "wait", timer = rng:NextNumber() * 5, dur = 1, s = 0, gy = groundY, nextGround = 0, list = {}, dust = {}, } for k = 1, CFG.Particles do local p, img, bb = createP(1) p.CFrame = PARKED local idx = #allParts + 1 allParts[idx], allCFs[idx], allBB[idx] = p, PARKED, bb v.list[k] = { idx = idx, img = img, bb = bb, pr = ((k - 1 + rng:NextNumber()) / CFG.Particles) ^ 1.15, ang = rng:NextNumber() * 360, rf = 0.7 + rng:NextNumber() * 0.6, sizeMul = 0.85 + rng:NextNumber() * 0.7, shade = (rng:NextNumber() - 0.5) * 0.1, seed = rng:NextNumber() * 100, } end for k = 1, CFG.DustPuffs do local p, img, bb = createP(1) p.CFrame = PARKED img.ImageColor3 = DUST_COLOR local idx = #allParts + 1 allParts[idx], allCFs[idx], allBB[idx] = p, PARKED, bb v.dust[k] = { idx = idx, img = img, bb = bb, ang = rng:NextNumber() * 360, rr = 0.6 + rng:NextNumber() * 1.6, hh = rng:NextNumber() ^ 2, sizeMul = 0.7 + rng:NextNumber() * 0.8, spin = 0.6 + rng:NextNumber() * 0.8, seed = rng:NextNumber() * 100, } end vortices[i] = v end -- ================================================================ -- panel button -- ================================================================ task.spawn(function() local scroll for _ = 1, 50 do local sg = Player.PlayerGui:FindFirstChild("TornadoControls") scroll = sg and sg:FindFirstChildWhichIsA("ScrollingFrame", true) if scroll then break end task.wait(0.2) end if not scroll then return end for _, b in ipairs(scroll:GetChildren()) do if b:IsA("TextButton") and string.sub(b.Text, 1, 13) == "MULTI-VORTEX:" then local nb = b:Clone() nb.Parent = scroll b:Destroy() nb.Text = "MULTI-VORTEX: " .. (CFG.Enabled and "ON" or "OFF") nb.MouseButton1Click:Connect(function() CFG.Enabled = not CFG.Enabled nb.Text = "MULTI-VORTEX: " .. (CFG.Enabled and "ON" or "OFF") end) break end end end) -- ================================================================ -- helpers -- ================================================================ local rayP = RaycastParams.new() rayP.FilterType = Enum.RaycastFilterType.Exclude local function groundAt(x, z, refY) local list = {funnelFolder} if Player.Character then list[#list + 1] = Player.Character end rayP.FilterDescendantsInstances = list local r = workspace:Raycast(Vector3.new(x, refY + 600, z), Vector3.new(0, -1500, 0), rayP) return r and r.Position.Y or refY end local function nightAmount() local ct = Lighting.ClockTime if ct >= 12 then return smooth((ct - 17.5) / 2) end return 1 - smooth((ct - 4.5) / 2) end local function rand(r) return r[1] + rng:NextNumber() * (r[2] - r[1]) end -- ================================================================ -- main loop -- ================================================================ local frame, nextLI = 0, 0 local parkedAll = true RunService:BindToRenderStep("TornadoMultiVortex", Enum.RenderPriority.Last.Value, function(dt) dt = math.min(dt, 0.1) frame += 1 local now = timeElapsed local sp = liveStormPos local allowed = CFG.Enabled and contact >= 0.6 local widthScale = 0.4 + 0.6 * descendProgress local baseR = funnelRadius(0) * widthScale local activeHeight = math.max(sm.Height * descendProgress, 1) local flash = lightningFlash local anyActive = false for vi, v in ipairs(vortices) do -- ---------- life cycle ---------- v.timer -= dt if not allowed then if v.state ~= "wait" and v.state ~= "rope" then v.state, v.timer, v.dur = "rope", 2, 2 end end if v.state == "wait" then v.s = 0 if allowed and v.timer <= 0 then v.state, v.dur = "grow", rand(CFG.GrowTime) v.timer = v.dur v.orbit += rng:NextNumber(-0.6, 0.6) end elseif v.state == "grow" then v.s = smooth(1 - v.timer / v.dur) if v.timer <= 0 then v.state, v.timer = "mature", rand(CFG.LifeTime) end elseif v.state == "mature" then v.s = 1 - 0.07 * (0.5 + math.noise(now * 0.3, v.seed)) if v.timer <= 0 then v.state, v.dur = "rope", rand(CFG.RopeTime) v.timer = v.dur end else -- rope out v.s = 1 - smooth(1 - v.timer / v.dur) v.s = math.min(v.s, 1) if v.timer <= 0 then v.state, v.timer, v.s = "wait", rand(CFG.GapTime), 0 end end if v.s <= 0.01 then for _, d in ipairs(v.list) do allCFs[d.idx] = PARKED end for _, d in ipairs(v.dust) do allCFs[d.idx] = PARKED end else anyActive = true -- ---------- position: orbit around the main funnel ---------- v.orbit += v.omega * dt local rho = (baseR * 0.9 + 40) * v.rho + 14 * math.sin(now * 0.5 + v.seed) local cx = sp.X + math.cos(v.orbit) * rho local cz = sp.Z + math.sin(v.orbit) * rho if now >= v.nextGround then v.nextGround = now + 0.4 v.gy = groundAt(cx, cz, v.gy) end local gy = v.gy -- shape local rope = (v.state == "rope") and (1 - v.s) or 0 -- 0 .. 1 while roping out local H = math.clamp(activeHeight * CFG.HeightFrac, CFG.MinHeight, CFG.MaxHeight) * (0.35 + 0.65 * v.s) local top = math.clamp(baseR * CFG.TopRadius, CFG.MinTop, CFG.MaxTop) * v.sizeMul * (1 - 0.55 * rope) local rb = CFG.BottomRadius * (1 - 0.4 * rope) local bx, bz = bendAt(0.45) local leanX = bx * 0.2 + math.noise(now * 0.12 + v.seed, 1.3) * H * 0.18 + rope * H * 0.35 local leanZ = bz * 0.2 + math.noise(2.7, now * 0.12 + v.seed) * H * 0.18 local spin = CFG.SpinDegPerSec * (1 + 0.04 * currentEF) -- ---------- funnel particles ---------- for _, d in ipairs(v.list) do local pr = d.pr d.ang += spin * (1 + (1 - pr) * 1.5) * dt local r = (rb + (top - rb) * pr ^ 1.7) * d.rf local a = math.rad(d.ang) local k2 = pr * pr allCFs[d.idx] = CFrame.new( cx + leanX * k2 + math.cos(a) * r, gy + pr * H, cz + leanZ * k2 + math.sin(a) * r) if (d.idx + frame) % 2 == 0 then local sz = (r * 2.2 + 14) * d.sizeMul * (0.55 + 0.45 * v.s) d.bb.Size = UDim2.new(sz, 0, sz, 0) local shade = 0.8 + 0.25 * pr + d.shade + math.noise(now * 0.2, d.seed) * 0.06 local col = tint(math.clamp(shade, 0.6, 1.2)) d.img.ImageColor3 = DUST_COLOR:Lerp(col, math.clamp(pr * 2.5, 0, 1)) local topFade = 1 - smooth((pr - 0.85) / 0.15) local tr = 0.3 + 0.45 * pr + 0.4 * (1 - v.s) d.img.ImageTransparency = tr + (1 - tr) * (1 - topFade * math.min(v.s * 2, 1)) end end -- ---------- dust at the base ---------- for _, d in ipairs(v.dust) do d.ang += spin * 0.45 * d.spin * dt local a = math.rad(d.ang) local r = (rb + top * 0.5) * d.rr + 10 local h = 2 + d.hh * (18 + top * 0.5) + math.sin(now * 0.8 + d.seed) * 3 allCFs[d.idx] = CFrame.new(cx + math.cos(a) * r, gy + h, cz + math.sin(a) * r) if (d.idx + frame) % 3 == 0 then local sz = (top * 1.6 + 30) * d.sizeMul d.bb.Size = UDim2.new(sz, 0, sz, 0) local sh = (0.9 + 0.2 * math.noise(now * 0.15, d.seed)) * (1 + flash * 0.6) d.img.ImageColor3 = Color3.new( math.clamp(DUST_COLOR.R * sh, 0, 1), math.clamp(DUST_COLOR.G * sh, 0, 1), math.clamp(DUST_COLOR.B * sh, 0, 1)) local tr = 0.55 + 0.25 * (1 - math.min(v.s * 1.5, 1)) d.img.ImageTransparency = tr + (1 - tr) * (1 - math.min(v.s * 2, 1)) end end end end if anyActive then parkedAll = false workspace:BulkMoveTo(allParts, allCFs, Enum.BulkMoveMode.FireCFrameChanged) elseif not parkedAll then parkedAll = true workspace:BulkMoveTo(allParts, allCFs, Enum.BulkMoveMode.FireCFrameChanged) end -- follow the lighting at night, like the rest of the storm if now >= nextLI then nextLI = now + 0.3 local li = nightAmount() * CFG.NightInfl for _, bb in ipairs(allBB) do bb.LightInfluence = li end end end) end)