Taller Lua

Catálogo/Comandos de admin

AdminAvanzado

Comandos de admin

Solo el UserId que indiques puede usar comandos por el chat. Para el dueño del juego, no para exploits de clientes ajenos.

Valores

Dónde va

  1. 01

    Tu UserId

    En roblox.com/users abre tu perfil. El número de la URL es el UserId. Ponlo arriba.

  2. 02

    Script

    Pega en ServerScriptService.

  3. 03

    Comandos

    /speed 32 · /coins 100 · /kick Nombre · /tp Nombre. El admin siempre es el UserId configurado.

Explorer → ServerScriptServiceScriptAdminComandos

AdminComandos.luaScript
--[[
  Comandos de admin · Taller Lua
  Pega este Script en ServerScriptService y pulsa Play.
  Es para TU juego en Roblox Studio — no es un exploit.
  Cambia ADMIN_USER_ID por tu UserId
]]

local Players = game:GetService("Players")

local ADMIN_USER_ID = 1

local function isAdmin(player)
	return player.UserId == ADMIN_USER_ID
end

local function findPlayer(name)
	name = string.lower(name)
	for _, player in ipairs(Players:GetPlayers()) do
		if string.sub(string.lower(player.Name), 1, #name) == name then
			return player
		end
	end
	return nil
end

local function announce(text)
	local hint = Instance.new("Hint")
	hint.Text = text
	hint.Parent = workspace
	task.delay(4, function()
		hint:Destroy()
	end)
end

Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		if not isAdmin(player) then
			return
		end
		local args = string.split(message, " ")
		local cmd = string.lower(args[1] or "")

		if cmd == "/speed" then
			local speed = tonumber(args[2]) or 16
			local humanoid = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
			if humanoid then
				humanoid.WalkSpeed = speed
			end
		elseif cmd == "/coins" then
			local amount = tonumber(args[2]) or 0
			local stats = player:FindFirstChild("leaderstats")
			local coins = stats and stats:FindFirstChild("Monedas")
			if coins then
				coins.Value += amount
			end
		elseif cmd == "/kick" then
			local target = findPlayer(args[2] or "")
			if target and target ~= player then
				target:Kick("Expulsado por el admin.")
			end
		elseif cmd == "/tp" then
			local target = findPlayer(args[2] or "")
			local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
			local other = target and target.Character and target.Character:FindFirstChild("HumanoidRootPart")
			if hrp and other then
				hrp.CFrame = other.CFrame + Vector3.new(0, 0, 4)
			end
		elseif cmd == "/help" then
			announce("/speed n  /coins n  /kick nombre  /tp nombre")
		end
	end)
end)