Adonis _G Api usage

Hello guys!

I’ve been searching over the dev forum but unluckily did not find a problem similar to mine and the ones who were sort of similar did not work. So basically am planning to give admin commands to the private servers owners. So that if they join their OWN private server, they get admin commands. I however am unaware of how to do this properly with the _G Adonis api and no other forum has this same problem, they show read data but not overrride data.

1 Like

I’ve looked into this, I don’t think it’s possible with Adonis

It is, The Robine, in their training facility they do it with adonis. But if you do not know with Adonis, do you know how with other admins?

Do you know with other admin if not possible with Adonis then?

Hi. This should work :stuck_out_tongue:

--// In Adonis_Loader > Config > Plugins > Server: GiveServerOwnerAdmin
return function()
  service.Players.PlayerAdded:Connect(function(p)
    if game.PrivateServerOwnerId == p.UserId then
        server.Admin.SetLevel(p, 3)
    end
  end)
end
8 Likes

And this is temporary, aka only work in his private server and not in punlic servers? By the way, is there a way on how to change the datastore key for private servers?

This is a far late reply, but in case someone stumbles upon this post and has the same question.

This is a case for ternary operators (donno what they’re called in lua).
condition == value and this or that

In this case, it would be:

settings.DataStore = game.PrivateServerId ~= "" and "Adonis"..game.PrivateServerOwnerId or "Adonis_WhateverForPublic"
3 Likes