Как сделать админку в роблоксе — ПОДРОБНЫЙ ГАЙД
Полная админ‑панель для Roblox Studio: подробный гайд
Разберу создание функциональной админ‑панели пошагово — от интерфейса до серверной логики.
Шаг 1. Создание GUI‑интерфейса
В Explorer найдите StarterGui → ПКМ → Insert Object → ScreenGui. Назовите AdminPanel.
Внутри AdminPanel создайте Frame (основное окно) и настройте:
Size: {0, 400}, {0, 500};
Position: {0.5, -200}, {0.5, -250} (по центру);
BackgroundColor3: Color3.fromRGB(30, 30, 30);
BorderSizePixel: 0;
Visible: false (изначально скрыта).
Добавьте элементы внутри Frame:
Заголовок: TextLabel с текстом «Админ‑панель», Size: {1, 0}, {0, 40}, TextColor3: белый.
Поле ввода: TextBox → PlayerNameBox, PlaceholderText: «Имя игрока», Size: {0.8, 0}, {0, 30}.
Кнопки (каждой задайте Size: {0.4, 0}, {0, 35}):
KickButton («Кикнуть»);
BanButton («Забанить»);
HealButton («Вылечить»);
TeleportButton («Телепорт к игроку»);
FlyButton («Полет»);
GodModeButton («Режим бога»).
Список игроков: ScrollingFrame → PlayerList, Size: {0.9, 0}, {0, 200}, BackgroundTransparency: 1.
Кнопка закрытия: TextButton → CloseButton, текст «×», Size: {0, 30}, {0, 30}.
Шаг 2. Настройка RemoteEvents
В ReplicatedStorage создайте:
RemoteEvent → AdminActions (для команд);
RemoteFunction → GetPlayerList (запрос списка игроков).
Шаг 3. Скрипт интерфейса (LocalScript в AdminPanel)
Вставьте код как дочерний LocalScript в AdminPanel:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AdminActions = ReplicatedStorage:WaitForChild("AdminActions")
local GetPlayerList = ReplicatedStorage:WaitForChild("GetPlayerList")
local player = Players.LocalPlayer
local gui = script.Parent
local frame = gui.Frame
local playerNameBox = frame.PlayerNameBox
local playerList = frame.PlayerList
-- Функция отправки команды
local function sendCommand(action, target)
AdminActions:FireServer(action, target)
end
-- Обновление списка игроков
local function updatePlayerList()
playerList:ClearAllChildren()
local players = GetPlayerNewtonList:InvokeServer()
for _, plr in ipairs(players) do
local label = Instance.new("TextLabel")
label.Text = plr.Name
label.Size = UDim2.new(1, 0, 0, 25)
label.BackgroundTransparency = 1
label.TextColor3 = Color3.new(1, 1, 1)
label.Parent = playerList
end
end
-- Обработчики кнопок
frame.KickButton.MouseButton1Click:Connect(function()
sendCommand("kick", playerNameBox.Text)
end)
frame.BanButton.MouseButton1Click:Connect(function()
sendCommand("ban", playerNameBox.Text)
end)
frame.HealButton.MouseButton1Click:Connect(function()
sendCommand("heal", playerNameBox.Text)
end)
frame.TeleportButton.MouseButton1Click:Connect(function()
sendCommand("teleport", playerNameBox.Text)
end)
frame.FlyButton.MouseButton1Click:Connect(function()
sendCommand("fly", playerNameBox.Text)
end)
frame.GodModeButton.MouseButton1Click:Connect(function()
sendCommand("godmode", playerNameBox.Text)
end)
frame.CloseButton.MouseButton1Click:Connect(function()
frame.Visible = false
end)
-- Показ панели по клавише F9
player.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F9 then
frame.Visible = not frame.Visible
if frame.Visible then
updatePlayerList()
end
end
end)
Шаг 4. Серверный скрипт (Script в ServerScriptService)
Создайте скрипт в ServerScriptService и вставьте:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AdminActions = ReplicatedStorage:WaitForChild("AdminActions")
local GetPlayerList = ReplicatedStorage:WaitForChild("GetPlayerList")
-- Список администраторов (замените на свои UserID)
local ADMINS = {12345678, 87654321}
-- Проверка прав
local function isAdmin(player)
return table.find(ADMINS, player.UserId) ~= nil
end
-- Получение списка игроков
GetPlayerList.OnServerInvoke = function()
local playerNames = {}
for _, plr in ipairs(Players:GetPlayers()) do
table.insert(playerNames, plr)
end
return playerNames
end
-- Обработка команд
AdminActions.OnServerEvent:Connect(function(player, action, targetName)
if not isAdmin(player) then
warn("Неавторизованный доступ: " .. player.Name)
return
end
local target = Players:FindFirstChild(targetName)
if not target then
return
end
-- Выполнение действий
if action == "kick" then
target:Kick("Кикнут администратором " .. player.Name)
elseif action == "ban" then
-- Здесь можно добавить запись в DataStore
target:Kick("Забанен администратором " .. player.Name)
elseif action == "heal" then
local character = target.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.Health = humanoid.MaxHealth
end
end
elseif action == "teleport" then
local character = target.Character
if character and player.Character then
character:SetPrimaryPartCFrame(player.Character:GetPivot())
end
elseif action == "fly" then
-- Для полёта нужно создать BodyVelocity
local character = target.Character
if character then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.Velocity = Vector3.new(0, 50, 0)
bodyVelocity.Parent = humanoidRootPart
game:GetService("Debris"):AddItem(bodyVelocity, 5) -- Удаляем через 5 с
end
end
elseif action == "godmode" then
local character = target.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.MaxHealth = math.huge
humanoid.Health = math.huge
end
end
end
-- Логирование действий
print(os.date("%X") .. " | " .. player.Name .. " выполнил " .. action .. " на " .. targetName)
end)
Шаг 5. Показ панели только админам
Добавьте ещё один скрипт в ServerScriptService:
local Players = game:GetService("Players")
local ADMINS = {12345678, 87654321} -- Те же ID, что и выше
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if table.find(ADMINS, player.UserId) then
-- Клонируем панель и отдаём игроку
local adminPanel = game.StarterGui.AdminPanel:Clone()
adminPanel.Parent = playerзвучит как скам
Какой скам? Это скрипт!