Admin commands open source
Key Required

Admin commands open source

Ray's Modswagdoge316swagdoge316 9.8K views 279 executesUpdated Apr 12, 2025
3.9/ 5(9 votes)
7278% Positive
Lua Script•129 lines (3891 chars)
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LocalPlayer = Players.LocalPlayer
local CoreGui = game:GetService("CoreGui")


local function kickPlayer(targetName, reason)
    local args = {
        [1] = targetName,
        [2] = reason or "No reason provided."
    }
    ReplicatedStorage:WaitForChild("VoteKickInProgress"):WaitForChild("VoteEvent"):FireServer(unpack(args))
end

local function scaleplayer(size)
    local allsizes = size
    for _, part in ipairs({"Depth", "Width", "Height", "Head"}) do
        local args = {[1] = allsizes}
        ReplicatedStorage:WaitForChild("PlayerScale"):WaitForChild(part):FireServer(unpack(args))
        task.wait()
    end
end

local function winVote()
    for _, player in ipairs(Players:GetPlayers()) do
        ReplicatedStorage:WaitForChild("VoteKickInProgress"):WaitForChild("VoteAdded"):FireServer()
    end
end

local function kickAll(reason)
    local excludeLocalPlayer = {
        [LocalPlayer.Name] = true
    }

    for _, player in ipairs(Players:GetPlayers()) do
        if not excludeLocalPlayer[player.Name] then
            kickPlayer(player.Name, reason)
            for _, p in ipairs(Players:GetPlayers()) do
                task.wait()
                ReplicatedStorage:WaitForChild("VoteKickInProgress"):WaitForChild("VoteAdded"):FireServer()
            end
            task.wait(15.7)
        end
    end
end

local function addHealth(healthInput)
    local timesToFire = math.floor(healthInput / 100)
    for i = 1, timesToFire do
        task.spawn(function()
            ReplicatedStorage:WaitForChild("MoreHealth"):FireServer()
        end)
    end
end

local function giveAddons()
    local localAddons = LocalPlayer.PlayerGui.Spawner.SpawnFrame.Addons
    local RSAddons = ReplicatedStorage:WaitForChild("AddonStorage"):GetChildren()

    for _, addon in ipairs(RSAddons) do
        local clonedAddon = addon:Clone()
        clonedAddon.Parent = localAddons
    end
end


local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "TrashAdminUI"
ScreenGui.Parent = CoreGui

local Frame = Instance.new("Frame")
Frame.Size = UDim2.new(0, 300, 0, 100)
Frame.Position = UDim2.new(0.3, 0, 0.3, 0)
Frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
Frame.Active = true
Frame.Draggable = true
Frame.Parent = ScreenGui

local Title = Instance.new("TextLabel")
Title.Size = UDim2.new(1, 0, 0, 30)
Title.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
Title.Text = "Trash Admin Commands"
Title.TextColor3 = Color3.fromRGB(255, 255, 255)
Title.Parent = Frame

local TextBox = Instance.new("TextBox")
TextBox.Size = UDim2.new(1, -10, 0, 40)
TextBox.Position = UDim2.new(0, 5, 0, 40)
TextBox.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
TextBox.PlaceholderText = "Enter command..."
TextBox.ClearTextOnFocus = false
TextBox.Parent = Frame


TextBox.FocusLost:Connect(function(enterPressed)
    if not enterPressed then return end

    local message = TextBox.Text
    TextBox.Text = ""

    local command, arg1, arg2 = string.match(message, "(%w+)%s*(%S*)%s*(.*)")

    if command == "kick" and arg1 then
        kickPlayer(arg1, arg2)
        for _, player in ipairs(Players:GetPlayers()) do
            task.wait()
            ReplicatedStorage:WaitForChild("VoteKickInProgress"):WaitForChild("VoteAdded"):FireServer()
        end

    elseif command == "kickall" then
        kickAll(arg1)

    elseif command == "HP" and tonumber(arg1) then
        addHealth(tonumber(arg1))

    elseif command == "addons" then
        giveAddons()

    elseif command == "win" then
        winVote()

    elseif command == "size" and tonumber(arg1) then
        scaleplayer(tonumber(arg1))
    end
end)

print("Trash Admin Commands (UI Version) loaded")
print("Commands available: kick, kickall, HP, addons, win, size")

Features & Information

Press F9 for commands kick/kickall when using kick has to be kick [ExactPlayername] not display Health All addons win vote size changer Only made these for fun Added a gui no more need for /e just type directly "HP 10000" in the gui that appears
#Rays Mod#Admin Commands#Admin#Open Source

Community Comments (10)

lawrencethee3rddlawrencethee3rddApr 12, 2025

don't think it works, tried. Maybe I did something wrong "/e kick .. .." i did put player name and reason and it still won't work.

swagdoge316swagdoge316Apr 12, 2025(edited)

Try pressing enter 2 times fast when you enter the command or try it again right after

lawrencethee3rddlawrencethee3rddApr 12, 2025

Tried, how do you even play this game, like do I have to choose a specific map for this script to work on?

swagdoge316swagdoge316Apr 12, 2025

I don't think it needs specific maps, just try multiplayer rm_construct

lawrencethee3rddlawrencethee3rddApr 12, 2025

Works, thanks

ababetiababetiApr 12, 2025

Doesn't worl

wackywackyApr 12, 2025

Works very good script!

LizaedplayerLizaedplayerApr 13, 2025

it gives me the list of commands but it dont work ,bc i tipe it in chat liks u should but nothing happens pls fix it, but for now ima dislike your script ty

Hydro_GenHydro_GenAug 26, 2025

i think/e addons are not working

polisukmark29polisukmark29Dec 30, 2025

It pacthed i think

More Scripts for Ray's Mod