Giving someone Admin Permission Via a script

Hiya developers,

I am currently making a system where players can gain admin acess through a server script, I am using Adonis admin for this and I seem to have ran into a bit of a headache.

Im getting an error when tryna add people to Admin using Adonis through a server script the documentation says to do this

local Adonis = _G.Adonis
local AdminAccess = Adonis.Access("MyKey", "Admin")
AdminAccess.AddAdmin(game.Players["Bear23913"], 100)

However im getting the error Incorrect key or G_Access is disabled. but the issue is these are what the settings are in the module script

settings.G_API = true
settings.G_Access = true
settings.G_Access_Key = "MyKey"
settings.G_Access_Perms = "write" 

All help is greatly appriciated!

I managed to play around with the settings.Allowed_API_Calls settings but its still not working but a different error:

Access Denied: AddAdmin

Hey there, did you try reading Adonis’s main module script contents at github? That could help you, however searching the ranking function and understanding it could take a while.

If you struggle in finding it, I’ll try to offer my help once I wake :sleeping_face:

Hiya yes I did just that however there is very limited documentation on doing this, with the only source of info about this topic being this..

In adonis, they have a settings.Ranks Table. Try using the search inside the script to find it. You can edit these with userids, usernames etc.

I’ll link adonis documentation below.

Try read “How to assign ranks”

Hiya, thanks for this but i fear you have missed the purpose of the post which may be my fault for not being clear enough, however I only want people to gain admin once a part of the script has been ran through I have omitted that part of the script from this post as currently im just doing a wait(10) and then the script to add admins through a script. I am doing this so i can get this part of the system working.

Oh! I apologise for the misunderstanding, I will look into what you mean soon when I wake up tomorrow. Sorry, I’m quite busy tonight.

sorry to bump, but you need to enable DataStore in the Allowed_API_Calls as well!