-- 📦 Services
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")

-- 🌐 Discord Webhook
local WebhookURL = "https://[Log in to view URL]"

-- 🔧 Webhook Logging Function
local function sendWebhookLog(action)
    local player = Players.LocalPlayer
    local data = {
        embeds = {{
            title = "🧾 Rayfield Action Log",
            color = 16753920,
            fields = {
                {
                    name = "👤 Player",
                    value = "**" .. player.DisplayName .. "** (`" .. player.Name .. "`)",
                    inline = false
                },
                {
                    name = "🪪 UserId",
                    value = tostring(player.UserId),
                    inline = true
                },
                {
                    name = "🎮 Action",
                    value = action,
                    inline = false
                },
            },
            footer = {
                text = "Logged from Rayfield UI"
            },
            timestamp = os.date("!%Y-%m-%dT%H:%M:%SZ")
        }}
    }

    local requestFunc = syn and syn.request or http and http.request or http_request or request or fluxus and fluxus.request
    if requestFunc then
        pcall(function()
            requestFunc({
                Url = WebhookURL,
                Method = "POST",
                Headers = {
                    ["Content-Type"] = "application/json"
                },
                Body = HttpService:JSONEncode(data)
            })
        end)
    else
        warn("Executor does not support HTTP requests.")
    end
end

-- 🌈 Load Rayfield UI
local Rayfield = loadstring(game:HttpGet('https://[Log in to view URL]'))()

-- 🪟 Create Main Window
local Window = Rayfield:CreateWindow({
    Name = "Rayfield Admin Hub",
    Icon = 0,
    LoadingTitle = "Rayfield Interface Suite",
    LoadingSubtitle = "by Sirius",
    Theme = "AmberGlow",
    ToggleUIKeybind = "K",
    DisableRayfieldPrompts = false,
    DisableBuildWarnings = false,
    ConfigurationSaving = {
        Enabled = true,
        FolderName = nil,
        FileName = "Big Hub"
    },
    Discord = {
        Enabled = false,
        Invite = "noinvitelink",
        RememberJoins = true
    },
    KeySystem = false,
    KeySettings = {
        Title = "Untitled",
        Subtitle = "Key System",
        Note = "No method of obtaining the key is provided",
        FileName = "Key",
        SaveKey = true,
        GrabKeyFromSite = false,
        Key = {"Hello"}
    }
})

-- 📂 Create Tabs
local AdminTab = Window:CreateTab("Admin Controls", 4483362458)
local PlayerTab = Window:CreateTab("Player Tools", 4483362459)

-- 🪙 Admin Commands Section
local AdminSection = AdminTab:CreateSection("Admin Actions")

-- 🔘 Speed Command
local SpeedInput = AdminTab:CreateSlider({
    Name = "Set WalkSpeed",
    Range = {16, 200},
    Increment = 1,
    Suffix = "Speed",
    CurrentValue = 16,
    Flag = "SpeedSlider",
    Callback = function(Value)
        local player = Players.LocalPlayer
        if player and player.Character and player.Character:FindFirstChild("Humanoid") then
            player.Character.Humanoid.WalkSpeed = Value
        end
        sendWebhookLog("Set WalkSpeed to `" .. Value .. "`")
    end,
})

-- 🔘 Reach Command
local ReachToggle = AdminTab:CreateToggle({
    Name = "Toggle Reach",
    CurrentValue = false,
    Flag = "ReachToggle",
    Callback = function(Value)
        sendWebhookLog("Toggled Reach: `" .. tostring(Value) .. "`")
    end,
})

-- 🖱️ Kill All Command (Fixed)
local KillAllButton = AdminTab:CreateButton({
    Name = "Kill All Players",
    Callback = function()
        for _, player in ipairs(Players:GetPlayers()) do
            if player.Character then
                local humanoid = player.Character:FindFirstChild("Humanoid")
                if humanoid then
                    humanoid.Health = 0
                end
            end
        end
        sendWebhookLog("Executed Kill All command.")
    end,
})

-- 🔘 Freeze Player Command (Fixed)
local FreezeInput = PlayerTab:CreateDropdown({
    Name = "Freeze Player",
    Options = function()
        local options = {}
        for _, player in ipairs(Players:GetPlayers()) do
            if player ~= Players.LocalPlayer then
                table.insert(options, player.Name)
            end
        end
        return options
    end,
    CurrentOption = "None",
    Flag = "FreezeDropdown",
    Callback = function(Option)
        local targetPlayer = Players:FindFirstChild(Option)
        if targetPlayer and targetPlayer.Character then
            local humanoid = targetPlayer.Character:FindFirstChild("Humanoid")
            if humanoid then
                humanoid.PlatformStand = true  -- Freezes the player
            end
            sendWebhookLog("Frozen player: `" .. Option .. "`")
        end
    end,
})

-- 🛠 Give Tool Command
local ToolInput = PlayerTab:CreateDropdown({
    Name = "Give Tool",
    Options = {"Sword", "Hammer", "Gun"},
    CurrentOption = "Sword",
    Flag = "ToolDropdown",
    Callback = function(Option)
        local tool = Instance.new("Tool")
        tool.Name = Option
        tool.Parent = Players.LocalPlayer.Backpack
        sendWebhookLog("Gave tool: `" .. Option .. "`")
    end,
})

-- 🧭 Teleport Command to Any Player
local TeleportInput = AdminTab:CreateDropdown({
    Name = "Teleport To Player",
    Options = function()
        local options = {}
        for _, player in ipairs(Players:GetPlayers()) do
            if player ~= Players.LocalPlayer then
                table.insert(options, player.Name)
            end
        end
        return options
    end,
    CurrentOption = "None",
    Flag = "TeleportDropdown",
    Callback = function(Option)
        local targetPlayer = Players:FindFirstChild(Option)
        if targetPlayer and targetPlayer.Character then
            local character = targetPlayer.Character
            local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
            if humanoidRootPart then
                Players.LocalPlayer.Character:SetPrimaryPartCFrame(humanoidRootPart.CFrame)
            end
            sendWebhookLog("Teleported to player: `" .. Option .. "`")
        else
            sendWebhookLog("Failed to teleport to player: `" .. Option .. "` (Player not found)")
        end
    end,
})

-- 🔘 Change Player Name Command
local ChangeNameInput = PlayerTab:CreateTextbox({
    Name = "Change Player Name",
    Placeholder = "Enter new name",
    Text = "",
    Flag = "ChangeNameTextbox",
    Callback = function(Value)
        local player = Players.LocalPlayer
        player.Name = Value
        sendWebhookLog("Changed player name to `" .. Value .. "`")
    end,
})

-- 🧰 More Admin Features Added Here...
-- Example: Kick Player
local KickPlayerButton = AdminTab:CreateButton({
    Name = "Kick Player",
    Callback = function()
        local playerToKick = Players:FindFirstChild("PlayerName")  -- Replace with logic for picking player
        if playerToKick then
            playerToKick:Kick("You have been kicked!")
            sendWebhookLog("Kicked player: `" .. playerToKick.Name .. "`")
        end
    end,
})

-- Example: Ban Player
local BanPlayerButton = AdminTab:CreateButton({
    Name = "Ban Player",
    Callback = function()
        local playerToBan = Players:FindFirstChild("PlayerName")  -- Replace with logic for picking player
        if playerToBan then
            -- Add your banning logic here (can add to a ban list, etc.)
            playerToBan:Kick("You have been banned!")
            sendWebhookLog("Banned player: `" .. playerToBan.Name .. "`")
        end
    end,
})

-- 📜 More features can go here as per your request...

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: