Open in the app to sign in, vote and reply

Suggestions · Done

Ability to run commands through the API on the server

· · 2 votes · 1 comments · imported from Discord · marked done by Team on 2026-09-23

Essentially just something like "hd:RunCommand([command here])".

This would be very useful for quickly doing things that are built-in to HD Admin without having to recode them if you wanna use them without a player manually entering in a command.

One common use/example could be an automatic temp ban if a player flags a simple anti-cheat check.

Ofc anything that could be done with this could be done by a developer just coding it themselves, but if they are already using HD Admin then this functionality could be very helpful for them.

Solved by Team · See the solution

Comments

Team · Solution

good news, v2 now has exactly this! it's called requestCommand and within the server api:

local hd = game:GetService("ReplicatedStorage"):WaitForChild("HD Admin")
local ServerAPI = require(hd.Core.ServerAPI)

-- runs as the server, so no permission checks
ServerAPI.requestCommand(";fly all")

-- or on behalf of a player, so their roles, permissions and rate limits apply, and so that it shows from this caller
ServerAPI.requestCommand(";fly me", player)

it runs the message exactly as if it was chatted and hands you back whether it was approved, any notices, and the tasks it created

for your anticheat example you'd do something like:

ServerAPI.requestCommand(`;timeBan {player.Name} 7d Exploiting`)

there's also a dedicated banAsync if you'd rather skip the command layer and pass options directly (reason, scope, duration, and it works for offline players too):

ServerAPI.banAsync(player, {
	reason = "Exploiting",
	scope = "expire",
	duration = 7 * 24 * 3600,
})

you can find the full docs at hdadmin.com/server-api/#requestcommand-server and hdadmin.com/using-the-api/