[NEW!] Admin Api

I have made a new roblox admin api. The thing that sets this apart is that it has a built in permission systems.

I hope you like it. If you have any suggestions for things to add or any criticize leave them below :heart:

This script is an example of how to use it:

--Require the API

local AdminApi = require(6073636355)

--Set Perm Values

AdminApi.SetCommandPerm("Kick", 2)
AdminApi.SetCommandPerm("Ban", 3)
AdminApi.SetCommandPerm("Unban", 3)
AdminApi.SetCommandPerm("Teleport", 1)
AdminApi.SetCommandPerm("Bring", 1)

game.Players.PlayerAdded:Connect(function(ActionPlayer)

local TargetPlayer = ActionPlayer --Setting Target To Player Cause Im On SinglePlayer Studio

--Set Player's Permission Value

AdminApi.SetPermNumber(ActionPlayer, 3)

--Admin Actions

AdminApi.KickPlayer(ActionPlayer, TargetPlayer, "Reason")
AdminApi.BanPlayer(ActionPlayer, TargetPlayer, "Reason")
AdminApi.UnbanPlayer(ActionPlayer, 151026010) -- my user id
AdminApi.TeleportPlayer(ActionPlayer, TargetPlayer)
AdminApi.BringPlayer(ActionPlayer, TargetPlayer)

end)

First you set a command perm for each of the admin functions
Second you set a command perm for each player

With this the player needs a command perm greater than or equal to the admin function perm to use it.

After that just use the different functions such as KickPlayer.

Reference:

Info:
Module Id - 6073636355

Functions:

KickPlayer()
BanPlayer()
UnbanPlayer()
TeleportPlayer()
BringPlayer()
SetPermNumber()
GetPermNumber()
GetAllPermNumbers()
SetCommandPerm()

Requirements:

Datastore enabled (for bans)

4 Likes

How will you unban a player if they aren’t in the game in the first place?

5 Likes

Thanks for pointing that out I just fixed it so now it uses the userid instead of the player instance.

1 Like

you should make it accept userId userName playerObject
obviously username and playerobject will only work if they are online

Why are the commands hardcoded? The SetCommandPerm seems like it would work with user created methods or maybe a table/module seeing as you take a command name as an argument. But, then you have AdminApi.KickPlayer, BanPlayer etc. Why not make this a modular admin API that allows users to create their own commands while using a built in permission system and whatever else you add for quality of life?

Something like AdminApi.Run(“Kick”, player) seems a lot better to me.

When I have time I’ll work on that. Thanks for the feedback!

1 Like