_G API: Community Documentation #603
Closed
Dimenpsyonal
started this conversation in
General
Replies: 5 comments 6 replies
-
Gonna formalize _G API docs on the wiki soon. |
Beta Was this translation helpful? Give feedback.
6 replies
-
Yeah right. As if Expertcoderz would do something helpful! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Holy shit July 11th, 2022 |
Beta Was this translation helpful? Give feedback.
0 replies
-
@StayBlue might interest you |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all, what is the _G API?
The _G API is short for Global, which means it can be executed in any script (assuming you have the right settings enabled).
There currently is no (good) documentation on the API, so I decided to make some.
Using the API
Settings
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 at all.settings.G_Access = false
This is optional for security, can be left false if you want. This controls wether 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 will not work though.settings.G_Access_Perms = "Read"
This controls what permissions other scripts have over the _G API, read or write.Usage in scripts
With _G.Access disabled:
_G.Adonis.Function(Input, Player(s))
For example,
_G.Adonis.Hint("Message", game.Players:GetPlayers())
would create a hint for all players with the word "Message".With _G.Access enabled:
Functions = _G.Adonis.Access("API Key", "Functions")
- Replace Functions with whatever functions you wish to access.For example,
local Admin = _G.Adonis.Access("TEST_KEY_SAMPLE", "Admin")
Admin.AddAdmin(game:GetService("Players")["player_name"], 900)
would give Creator admin to the player called "the_name".Functions
These are all the functions you can use with _G.Adonis. Most of them are self-explanatory.
IsAdmin
IsBanned
IsMuted
CheckDonor
GetLevel
SetLighting
SetPlayerLighting
NewParticle
RemoveParticle
NewLocal
MakeLocal
MoveLocal
RemoveLocal
Hint
Message
RunCommandAsNonAdmin
Beta Was this translation helpful? Give feedback.
All reactions