--[[ COSMIC HUB: Visual System (Update V2) Platform: Delta Executor / Client-Side Features: Meteors, 10s Debris, Draggable UI, Pause/Resume ]] local Players = game:GetService("Players") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService") local Lighting = game:GetService("Lighting") local Debris = game:GetService("Debris") local UserInputService = game:GetService("UserInputService") local CoreGui = game:GetService("CoreGui") -- Using CoreGui to hide from game resets local Plr = Players.LocalPlayer local Cam = workspace.CurrentCamera -- // CONFIGURATION // local SETTINGS = { MeteorColor1 = Color3.fromRGB(255, 100, 0), MeteorColor2 = Color3.fromRGB(150, 0, 255), MeteorColor3 = Color3.fromRGB(255, 0, 50), DebrisLifetime = 10, -- UPDATED: 10 Seconds ShakeMultiplier = 1.5, SpawnRate = 0.2 -- Speed of meteors } -- // STATE // local CosmicState = { IsActive = true, IsPaused = false, ShakeIntensity = 0 } -- // ASSETS // local SOUNDS = { Explosion = "rbxassetid://163619849", Whistle = "rbxassetid://3303666245", Bass = "rbxassetid://165970126" } -- // UI SETUP (The "Hub") // local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "CosmicHubUI" -- Try to parent to CoreGui for executor safety, fallback to PlayerGui pcall(function() ScreenGui.Parent = CoreGui end) if not ScreenGui.Parent then ScreenGui.Parent = Plr:WaitForChild("PlayerGui") end -- 1. WAIT PROMPT local WaitLabel = Instance.new("TextLabel") WaitLabel.Size = UDim2.new(1, 0, 0.1, 0) WaitLabel.Position = UDim2.new(0, 0, 0.45, 0) WaitLabel.BackgroundTransparency = 1 WaitLabel.Text = "⚠ SYSTEM LOADING: PLEASE WAIT FOR EVENT..." WaitLabel.TextColor3 = Color3.fromRGB(255, 50, 50) WaitLabel.TextStrokeTransparency = 0 WaitLabel.Font = Enum.Font.GothamBold WaitLabel.TextSize = 24 WaitLabel.Parent = ScreenGui -- 2. CONTROLS PROMPT local ControlLabel = Instance.new("TextLabel") ControlLabel.Size = UDim2.new(1, 0, 0.1, 0) ControlLabel.Position = UDim2.new(0, 0, 0.8, 0) ControlLabel.BackgroundTransparency = 0.5 ControlLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0) ControlLabel.Text = "CONTROLS: PRESS 'P' OR USE THE BUTTON TO PAUSE/RESUME" ControlLabel.TextColor3 = Color3.fromRGB(255, 255, 255) ControlLabel.Font = Enum.Font.Gotham ControlLabel.TextSize = 20 ControlLabel.Visible = false ControlLabel.Parent = ScreenGui -- 3. DRAGGABLE TOGGLE BUTTON local ButtonFrame = Instance.new("Frame") ButtonFrame.Size = UDim2.new(0, 120, 0, 50) ButtonFrame.Position = UDim2.new(0.05, 0, 0.5, 0) ButtonFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) ButtonFrame.BorderSizePixel = 0 ButtonFrame.Visible = false -- Hidden initially ButtonFrame.Active = true -- Important for dragging ButtonFrame.Parent = ScreenGui local UICorner = Instance.new("UICorner", ButtonFrame) UICorner.CornerRadius = UDim.new(0, 8) local ToggleBtn = Instance.new("TextButton") ToggleBtn.Size = UDim2.new(1, 0, 1, 0) ToggleBtn.BackgroundTransparency = 1 ToggleBtn.Text = "ON / OFF" ToggleBtn.TextColor3 = Color3.fromRGB(255, 100, 100) -- Red initially (Active) ToggleBtn.Font = Enum.Font.GothamBlack ToggleBtn.TextSize = 18 ToggleBtn.Parent = ButtonFrame -- // DRAGGABLE LOGIC // local dragging, dragInput, dragStart, startPos local function update(input) local delta = input.Position - dragStart ButtonFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end ButtonFrame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = ButtonFrame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) ButtonFrame.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 update(input) end end) -- // BUTTON FUNCTIONALITY // local function ToggleSystem() CosmicState.IsPaused = not CosmicState.IsPaused if CosmicState.IsPaused then ToggleBtn.Text = "PAUSED" ToggleBtn.TextColor3 = Color3.fromRGB(100, 255, 100) -- Green else ToggleBtn.Text = "ON / OFF" ToggleBtn.TextColor3 = Color3.fromRGB(255, 100, 100) -- Red end end ToggleBtn.MouseButton1Click:Connect(ToggleSystem) -- // VISUAL SYSTEMS // -- Camera Shake RunService.RenderStepped:Connect(function() if CosmicState.ShakeIntensity > 0 and not CosmicState.IsPaused then local shake = CosmicState.ShakeIntensity local offset = Vector3.new(math.random()-0.5, math.random()-0.5, math.random()-0.5) * shake Cam.CFrame = Cam.CFrame * CFrame.new(offset) CosmicState.ShakeIntensity = math.clamp(CosmicState.ShakeIntensity - 0.05, 0, 10) end end) local function PlaySound(id, pos, vol) local s = Instance.new("Sound") s.SoundId = id s.Volume = vol or 1 s.Parent = workspace s:Play() Debris:AddItem(s, 5) end local function SpawnMeteor() if not Plr.Character or not Plr.Character:FindFirstChild("HumanoidRootPart") then return end local center = Plr.Character.HumanoidRootPart.Position local targetPos = center + Vector3.new(math.random(-150,150), 0, math.random(-150,150)) local spawnPos = targetPos + Vector3.new(math.random(-50,50), 300, math.random(-50,50)) -- Meteor local meteor = Instance.new("Part") meteor.Shape = "Ball" meteor.Size = Vector3.new(6,6,6) meteor.Material = "Neon" meteor.Color = SETTINGS.MeteorColor1 meteor.Position = spawnPos meteor.Anchored = true meteor.CanCollide = false meteor.Parent = workspace -- Whistle Sound PlaySound(SOUNDS.Whistle, meteor, 0.5) local tween = TweenService:Create(meteor, TweenInfo.new(1.5, Enum.EasingStyle.Linear), {Position = targetPos}) tween:Play() tween.Completed:Connect(function() meteor:Destroy() if CosmicState.IsPaused then return end -- Don't explode if paused mid-air -- Explosion Sound PlaySound(SOUNDS.Explosion, targetPos, 2) -- Visuals local exp = Instance.new("Part") exp.Shape = "Ball" exp.Material = "Neon" exp.Color = SETTINGS.MeteorColor2 exp.Size = Vector3.new(1,1,1) exp.Position = targetPos exp.Anchored = true exp.CanCollide = false exp.Parent = workspace TweenService:Create(exp, TweenInfo.new(0.5), {Size = Vector3.new(40,40,40), Transparency = 1}):Play() Debris:AddItem(exp, 1) -- UPDATED: Debris (Lasts 10 Seconds) for i=1, 6 do local rock = Instance.new("Part") rock.Size = Vector3.new(1.5,1.5,1.5) rock.Position = targetPos rock.Color = Color3.fromRGB(20,20,20) rock.Material = Enum.Material.Slate rock.Velocity = Vector3.new(math.random(-60,60), math.random(50,100), math.random(-60,60)) rock.Parent = workspace -- HERE IS THE CHANGE: 10 SECONDS Debris:AddItem(rock, SETTINGS.DebrisLifetime) end -- Shake local dist = (center - targetPos).Magnitude if dist < 100 then CosmicState.ShakeIntensity = 2 end end) end -- // MAIN SEQUENCE CONTROLLER // task.spawn(function() -- 1. Initial Wait task.wait(4) -- Wait for user to read "Loading" -- 2. Transition to Event WaitLabel:Destroy() -- Show Controls for 5 seconds ControlLabel.Visible = true -- Start Lighting Effect local cc = Instance.new("ColorCorrectionEffect", Lighting) TweenService:Create(cc, TweenInfo.new(3), {TintColor = Color3.fromRGB(255, 200, 200), Contrast = 0.2}):Play() -- 3. Show Button after 5 seconds task.delay(5, function() ControlLabel:Destroy() ButtonFrame.Visible = true -- Show Draggable Button end) -- 4. Main Loop while CosmicState.IsActive do if not CosmicState.IsPaused then SpawnMeteor() task.wait(SETTINGS.SpawnRate + math.random()*0.5) else -- If paused, just wait a bit and check again task.wait(0.5) end end end) -- Keyboard Shortcut (P) UserInputService.InputBegan:Connect(function(input, chat) if chat then return end if input.KeyCode == Enum.KeyCode.P then ToggleSystem() end end)