All abuse

🚀 āļĢāļ°āļšāļšāđāļ­āļ”āļĄิāļ™ Global Event (GUI/F2) āļŠāļģāļŦāļĢัāļš Roblox

āļĢāļ°āļšāļšāļ™ี้āļ­āļ™ุāļāļēāļ•āđƒāļŦ้āđāļ­āļ”āļĄิāļ™ (**sannnn5302** āđāļĨāļ° prim233510) āđ€āļ›ิāļ”āđƒāļŠ้āļ‡āļēāļ™āļ­ีāđ€āļ§āļ™āļ•์āļ—ั่āļ§āļ—ั้āļ‡āđ€āļ‹ิāļĢ์āļŸāđ€āļ§āļ­āļĢ์āđ„āļ”้āļœ่āļēāļ™āļāļēāļĢāļāļ”āļ›ุ่āļĄ **F2** āļŦāļĢืāļ­āđ€āļĄāļ™ู GUI āđ€āļ—่āļēāļ™ั้āļ™ (āļĒāļāđ€āļĨิāļāļāļēāļĢāđƒāļŠ้āļ„āļģāļŠั่āļ‡āđāļŠāļ—)


🛠️ Part 1: āļāļēāļĢāļ•ั้āļ‡āļ„่āļēāļ—ี่āļˆāļģāđ€āļ›็āļ™

āļ่āļ­āļ™āđ€āļžิ่āļĄāđ‚āļ„้āļ” āđƒāļŦ้āļŠāļĢ้āļēāļ‡āđāļĨāļ°āļ•ั้āļ‡āļ„่āļēāļ§ัāļ•āļ–ุāđ€āļŦāļĨ่āļēāļ™ี้āđƒāļ™ Explorer:

  • **RemoteEvent āļŠื่āļ­ DiscoTrigger** (āđƒāļ™ ReplicatedStorage): āđƒāļŠ้āļŠāļģāļŦāļĢัāļš Server → Client (āđāļˆ้āļ‡āđ€āļ•ืāļ­āļ™āđ€āļŦāļ•ุāļāļēāļĢāļ“์)
  • **RemoteEvent āļŠื่āļ­ AdminCommandEvent** (āđƒāļ™ ReplicatedStorage): **<<< RemoteEvent āđƒāļŦāļĄ่!** āđƒāļŠ้āļŠāļģāļŦāļĢัāļš Client → Server (āļŠ่āļ‡āļ„āļģāļŠั่āļ‡āļˆāļēāļ GUI)
  • **Part āļŠื่āļ­ DiscoFloor** (āđƒāļ™ Workspace)
  • **Sound āļŠื่āļ­ DiscoMusic** (āđƒāļ™ ReplicatedStorage): SoundId: rbxassetid://142376088
  • **Sound āļŠื่āļ­ UnderwaterAmbiance** (āđƒāļ™ ReplicatedStorage): SoundId: rbxassetid://177465360
  • **ScreenGui āļŠื่āļ­ AdminMenu** (āđƒāļ™ StarterGui)
    • āļ āļēāļĒāđƒāļ™ AdminMenu āļŠāļĢ้āļēāļ‡ **Frame** āļŠื่āļ­ **MenuFrame** (āļ•ั้āļ‡āļ„่āļē Visible āđ€āļ›็āļ™ False)
    • āļ āļēāļĒāđƒāļ™ MenuFrame āļŠāļĢ้āļēāļ‡ **TextButton** āļŠื่āļ­: DiscoButton, UnderwaterButton, SwimAirButton, āđāļĨāļ° CloseButton

🔑 Part 2: Server Script (āđƒāļ™ ServerScriptService)

āđ‚āļ„้āļ”āļ™ี้āļĢัāļšāļ„āļģāļŠั่āļ‡āļˆāļēāļ GUI āđāļĨāļ°āļŠั่āļ‡āļ‡āļēāļ™āđ€āļŦāļ•ุāļāļēāļĢāļ“์āļ—ั่āļ§āļ—ั้āļ‡āđ€āļ‹ิāļĢ์āļŸāđ€āļ§āļ­āļĢ์

āļ•āļģāđāļŦāļ™่āļ‡: **Script** āđƒāļ™ ServerScriptService


-- Script āđƒāļ™ ServerScriptService
local MessagingService = game:GetService("MessagingService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- --- Configuration ---
local DISCO_TOPIC = "GlobalEvents" 
local DISCO_DURATION = 300 -- 5 āļ™āļēāļ—ี
local UNDERWATER_DURATION = 600 -- 10 āļ™āļēāļ—ี
local SWIM_AIR_DURATION = 180 -- 3 āļ™āļēāļ—ี
local DISCO_TRIGGER = ReplicatedStorage:WaitForChild("RemoteEvent"):WaitForChild("DiscoTrigger")
local ADMIN_COMMAND_EVENT = ReplicatedStorage:WaitForChild("AdminCommandEvent") -- RemoteEvent āđƒāļŦāļĄ่

-- **ADMIN LIST**
local ALLOWED_USERS = {
    ["sannnn5302"] = true,
    ["prim233510"] = true,
}

-- --- 1. Subscription (āļĢัāļš Global Message) ---

local function onGlobalMessageReceived(message)
    local data = message.Data
    
    -- āļŠ่āļ‡āļ„āļģāļŠั่āļ‡āđ„āļ›āļĒัāļ‡ Clients āđƒāļ™ Server āļ™ี้
    if data and data.Command == "StartDisco" then
        DISCO_TRIGGER:FireAllClients("StartDisco", data.Duration)
    elseif data and data.Command == "StopDisco" then
        DISCO_TRIGGER:FireAllClients("StopDisco")
    elseif data and data.Command == "StartUnderwater" then
        DISCO_TRIGGER:FireAllClients("StartUnderwater", data.Duration)
    elseif data and data.Command == "StopUnderwater" then
        DISCO_TRIGGER:FireAllClients("StopUnderwater")
    elseif data and data.Command == "StartSwimAir" then
        DISCO_TRIGGER:FireAllClients("StartSwimAir") 
    elseif data and data.Command == "StopSwimAir" then
        DISCO_TRIGGER:FireAllClients("StopSwimAir")
    end
end

pcall(function()
    MessagingService:SubscribeAsync(DISCO_TOPIC, onGlobalMessageReceived)
end)


-- --- 2. Publishing (āļŠ่āļ‡ Global Message) ---

local function publishGlobalEvent(command, duration)
    local data = {
        Command = command,
        Duration = duration
    }
    
    pcall(function()
        MessagingService:PublishAsync(DISCO_TOPIC, data)
        print("Published '" .. command .. "' command to all servers.")
    end)
end


-- --- 3. Command Check (āļĢัāļšāļ„āļģāļŠั่āļ‡āļˆāļēāļ GUI āļœ่āļēāļ™ RemoteEvent) ---
ADMIN_COMMAND_EVENT.OnServerEvent:Connect(function(player, command)
    
    -- āļ•āļĢāļ§āļˆāļŠāļ­āļšāļŠิāļ—āļ˜ิ์āđāļ­āļ”āļĄิāļ™
    if not ALLOWED_USERS[player.Name] then
        warn(player.Name .. " attempted to use admin command without authorization.")
        return
    end

    if command == "StartDisco" then 
        publishGlobalEvent("StartDisco", DISCO_DURATION) 
    elseif command == "StopDisco" then
        publishGlobalEvent("StopDisco")
    
    elseif command == "StartUnderwater" then
        publishGlobalEvent("StartUnderwater", UNDERWATER_DURATION) 
    elseif command == "StopUnderwater" then
        publishGlobalEvent("StopUnderwater")
        
    elseif command == "StartSwimAir" then
        publishGlobalEvent("StartSwimAir") 
        task.delay(SWIM_AIR_DURATION, function()
            publishGlobalEvent("StopSwimAir")
        end)
    elseif command == "StopSwimAir" then
        publishGlobalEvent("StopSwimAir")
    end
end)

✨ Part 3: Client Script (āđƒāļ™ StarterPlayerScripts)

āđ‚āļ„้āļ”āļ™ี้āļˆัāļ”āļāļēāļĢ GUI, āļ›ุ่āļĄ F2, āļāļēāļĢāļ‹่āļ­āļ™āđ€āļĄāļ™ูāļˆāļēāļāļœู้āđ€āļĨ่āļ™āļ—ั่āļ§āđ„āļ›, āđāļĨāļ°āļāļēāļĢāļ—āļģāļ‡āļēāļ™āļ‚āļ­āļ‡ Event Effects

āļ•āļģāđāļŦāļ™่āļ‡: **LocalScript** āđƒāļ™ StarterPlayer > StarterPlayerScripts


-- LocalScript āđƒāļ™ StarterPlayerScripts
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local Player = Players.LocalPlayer

local ADMIN_COMMAND_EVENT = ReplicatedStorage:WaitForChild("AdminCommandEvent")
local DISCO_TRIGGER = ReplicatedStorage:WaitForChild("RemoteEvent"):WaitForChild("DiscoTrigger")

-- --- Configuration (Event Assets) ---
local DISCO_SOUND = ReplicatedStorage:WaitForChild("DiscoMusic")
local DISCO_PART = game.Workspace:WaitForChild("DiscoFloor")
local SHARED_EVENT_SOUND = ReplicatedStorage:WaitForChild("UnderwaterAmbiance") 

-- GUI References
local ADMIN_MENU = Player.PlayerGui:WaitForChild("AdminMenu")
local MENU_FRAME = ADMIN_MENU:WaitForChild("MenuFrame")

-- Stored original values for cleanup
local originalDiscoColor = DISCO_PART.Color
local originalFogColor = Lighting.FogColor
local originalFogEnd = Lighting.FogEnd
local originalAmbient = Lighting.Ambient
local originalWalkSpeed = 16 

-- State variables
local isDiscoActive = false
local isUnderwaterActive = false
local isSwimAirActive = false
local discoConnection = nil

-- **ADMIN LIST (āļ•้āļ­āļ‡āļ•āļĢāļ‡āļัāļš Server)**
local ALLOWED_USERS = {
    ["sannnn5302"] = true,
    ["prim233510"] = true,
}

local isPlayerAdmin = ALLOWED_USERS[Player.Name]


-- --- GUI & Input Handlers ---

-- āļŸัāļ‡āļ์āļŠัāļ™āļŠāļģāļŦāļĢัāļšāđ€āļ›ิāļ”/āļ›ิāļ”āđ€āļĄāļ™ู
local function toggleMenu()
    if isPlayerAdmin then
        MENU_FRAME.Visible = not MENU_FRAME.Visible
    end
end

-- āļŸัāļ‡āļ์āļŠัāļ™āđ€āļĄื่āļ­āļĄีāļāļēāļĢāļāļ”āļ›ุ่āļĄ F2
local function onInputBegan(input, gameProcessed)
    if input.KeyCode == Enum.KeyCode.F2 and not gameProcessed then
        toggleMenu()
    end
end

-- āļŸัāļ‡āļ์āļŠัāļ™āļŠāļģāļŦāļĢัāļšāļŠ่āļ‡āļ„āļģāļŠั่āļ‡āļœ่āļēāļ™ RemoteEvent
local function fireAdminCommand(commandName)
    if isPlayerAdmin and MENU_FRAME.Visible then
        ADMIN_COMMAND_EVENT:FireServer(commandName)
        -- āļ›ิāļ”āđ€āļĄāļ™ูāļŦāļĨัāļ‡āļˆāļēāļāļŠ่āļ‡āļ„āļģāļŠั่āļ‡
        MENU_FRAME.Visible = false
    end
end


-- --- Shared Event Logic ---

-- Helper function to start shared sound/fog effects
local function startSharedVisuals()
    -- Only play the sound if neither Underwater nor SwimAir is active
    if not SHARED_EVENT_SOUND.Playing then
        SHARED_EVENT_SOUND:Play()
        Lighting.FogColor = Color3.new(0.5, 0.5, 1) -- Ethereal Blue Fog
        Lighting.FogEnd = 50 
    end
end

-- Helper function to stop shared sound/fog effects
local function stopSharedVisuals()
    -- Only stop if NEITHER event is active after the current one stops
    if not isUnderwaterActive and not isSwimAirActive then
        SHARED_EVENT_SOUND:Stop()
        Lighting.FogColor = originalFogColor
        Lighting.FogEnd = originalFogEnd
    end
end


-- --- 3 Separate Event Functions (āđ€āļŦāļĄืāļ­āļ™āđ‚āļ„้āļ”āđ€āļ”ิāļĄ) ---

local function startDisco(duration)
    if isDiscoActive then return end
    isDiscoActive = true
    DISCO_SOUND:Play()
    Lighting.Ambient = Color3.new(0, 0, 0)
    discoConnection = RunService.Heartbeat:Connect(function(dt)
        local hue = tick() * 0.15 % 1
        DISCO_PART.Color = Color3.fromHSV(hue, 1, 1)
    end)
    task.delay(duration, function()
        if isDiscoActive then stopDisco() end
    end)
end

local function stopDisco()
    if not isDiscoActive then return end
    isDiscoActive = false
    if discoConnection then
        discoConnection:Disconnect()
        discoConnection = nil
    end
    DISCO_SOUND:Stop()
    DISCO_PART.Color = originalDiscoColor
    Lighting.Ambient = originalAmbient
end

local function startUnderwater(duration)
    if isUnderwaterActive then return end
    isUnderwaterActive = true
    startSharedVisuals()
    if Player.Character and Player.Character:FindFirstChild("Humanoid") then
        Player.Character.Humanoid.WalkSpeed = 8
    end
    task.delay(duration, function()
        if isUnderwaterActive then 
            isUnderwaterActive = false 
            stopUnderwater()
        end
    end)
end

local function stopUnderwater()
    if Player.Character and Player.Character:FindFirstChild("Humanoid") then
        Player.Character.Humanoid.WalkSpeed = originalWalkSpeed
    end
    isUnderwaterActive = false 
    stopSharedVisuals()
end

local function startSwimAir()
    if isSwimAirActive then return end
    isSwimAirActive = true
    startSharedVisuals()
    local character = Player.Character
    if character and character:FindFirstChild("Humanoid") then
        character.Humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
        workspace.Gravity = 50 
    end
end

local function stopSwimAir()
    local character = Player.Character
    if character and character:FindFirstChild("Humanoid") then
        character.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) 
    end
    workspace.Gravity = 196 
    isSwimAirActive = false 
    stopSharedVisuals()
end


-- --- Initialization and Connections ---

if not isPlayerAdmin then
    -- āļ‹่āļ­āļ™ GUI āđāļĨāļ°āļŦāļĒุāļ” LocalScript āļŠāļģāļŦāļĢัāļšāļœู้āđ€āļĨ่āļ™āļ—ี่āđ„āļĄ่āđƒāļŠ่āđāļ­āļ”āļĄิāļ™
    ADMIN_MENU.Enabled = false
else
    -- āđ€āļŠื่āļ­āļĄāļ•่āļ­āļ›ุ่āļĄ F2
    UserInputService.InputBegan:Connect(onInputBegan)

    -- āđ€āļŠื่āļ­āļĄāļ•่āļ­āļ›ุ่āļĄ GUI
    MENU_FRAME:WaitForChild("DiscoButton").Text = "1. Start Disco"
    MENU_FRAME:WaitForChild("DiscoButton").MouseButton1Click:Connect(function()
        fireAdminCommand("StartDisco")
    end)

    MENU_FRAME:WaitForChild("UnderwaterButton").Text = "2. Start Underwater"
    MENU_FRAME:WaitForChild("UnderwaterButton").MouseButton1Click:Connect(function()
        fireAdminCommand("StartUnderwater")
    end)

    MENU_FRAME:WaitForChild("SwimAirButton").Text = "3. Start Swim in Air"
    MENU_FRAME:WaitForChild("SwimAirButton").MouseButton1Click:Connect(function()
        fireAdminCommand("StartSwimAir")
    end)
    
    -- āļ›ุ่āļĄāļ›ิāļ”āđ€āļĄāļ™ู
    MENU_FRAME:WaitForChild("CloseButton").MouseButton1Click:Connect(function()
        MENU_FRAME.Visible = false
    end)

    -- āļ„āļģāļŠั่āļ‡āđ€āļŠāļĢิāļĄ: āļ›ุ่āļĄ Stop All (āļ–้āļēāļ„ุāļ“āļĄี)
    local stopButton = MENU_FRAME:FindFirstChild("StopAllButton") 
    if stopButton then
        stopButton.Text = "STOP ALL EVENTS"
        stopButton.MouseButton1Click:Connect(function()
            fireAdminCommand("StopDisco")
            fireAdminCommand("StopUnderwater")
            fireAdminCommand("StopSwimAir")
        end)
    end
end


-- --- GLOBAL EVENT LISTENER ---
DISCO_TRIGGER.OnClientEvent:Connect(function(command, duration)
    if command == "StartDisco" then
        stopUnderwater() 
        stopSwimAir()
        startDisco(duration)
    elseif command == "StopDisco" then
        stopDisco()
    elseif command == "StartUnderwater" then
        stopDisco()
        stopSwimAir() 
        startUnderwater(duration)
    elseif command == "StopUnderwater" then
        stopUnderwater()
    elseif command == "StartSwimAir" then
        stopDisco()
        stopUnderwater() 
        startSwimAir()
    elseif command == "StopSwimAir" then
        stopSwimAir()
    end
end)

āļ„āļ§āļēāļĄāļ„ิāļ”āđ€āļŦ็āļ™

āđ‚āļžāļŠāļ•์āļĒāļ­āļ”āļ™ิāļĒāļĄāļˆāļēāļāļšāļĨ็āļ­āļāļ™ี้

Script key