-
-
Notifications
You must be signed in to change notification settings - Fork 184
G API
Dimenpsyonal edited this page Aug 11, 2024
·
16 revisions
First of all, what is the _G API?
The _G API is an API which allows scripts to interact globally. Adonis uses this to create select functions that can be interacted with by any server script, meaning any server script can access certain Adonis events using _G.Adonis.
To start, you need to have the appropriate settings enabled.
-
settings.G_API = true
This needs to be set to true so that the _G.Adonis API can be used. -
settings.G_Access = false
This is optional for security, can be left false if you want. This controls whether scripts need an access key to use _G.Adonis. -
settings.G_Access_Key = "Example_Key"
This can be used to set an access key if the above setting is set to true. Example_Key is excluded and will not work. -
settings.G_Access_Perms = "Read"
This controls what permissions other scripts have over the _G API, read or write.
_G.Adonis.Function(Input, Player(s))
_G.Adonis.Hint("Message", game.Players:GetPlayers())
would create a hint for all players with the word "Message".
-
Functions = _G.Adonis.Access("API Key", "Functions")
- Replace Functions with whatever functions you wish to access.
local AdminAccess = _G.Adonis.Access("TEST_KEY_SAMPLE", "Admin")
-
AdminAccess.AddAdmin(game:GetService("Players")["epix_agent"], 900)
would give Creator admin to the player called "epix_agent".
These are all the functions you can use with _G.Adonis. Most of them are self-explanatory.
Msg1 | Msg2 | Msg3 |
Msg4 |
- CheckAdmin / IsAdmin
_G.Adonis.CheckAdmin(player)
- CheckBan / IsBanned
_G.Adonis.CheckBan(player)
- IsMuted
_G.Adonis.IsMuted(player)
- CheckDonor
_G.Adonis.CheckDonor(player)
- GetLevel
_G.Adonis.GetLevel(player)
- SetLighting
_G.Adonis.SetLighting(property, value)
- SetPlayerLighting
_G.Adonis.SetLighting(player, property, value)
- NewParticle
_G.Adonis.NewParticle(player, particleType, properties)
- RemoveParticle
_G.Adonis.NewParticle(player, particleName)
- NewLocal
_G.Adonis.NewLocal(player, class, properties, parent)
- MakeLocal
_G.Adonis.MakeLocal(player, object, parent, isClone)
- MoveLocal
_G.Adonis.MoveLocal(player, object, parent, newParent)
- RemoveLocal
_G.Adonis.RemoveLocal(player, object, parent, shouldMatch)
- Hint
_G.Adonis.Hint(message, players, duration, title, image)
- Message
_G.Adonis.Message(sender, title, message, image, players, scroll, duration)
- RunCommandAsNonAdmin
_G.Adonis.RunCommandAsNonAdmin(command, plr, ...)
Start | Guides | Tables |
---|---|---|
Home | Creating a theme | The "Service" Metatable |