#How do I let a script run an a command as admin
1 messages · Page 1 of 1 (latest)
Great question
Depends on which command you want to run
which commands DO you want to run
hold on ill need some time to think about which ones didnt think it would depend on the command and was asking for future refference
cut, setgrav, grav, poison, sfling, and refresh
You’d need to enable _G.Access in the settings
I do have that enabled
Here’s an example of the script giving admin level 900 to a player named player_name
_G.Adonis.Access("TEST_KEY_SAMPLE", "Admin" ).AddAdmin(game:GetService ("Players")["player_name" ],900)
whenever calling _G.Adonis.Access its giving me the error of attempt to index nil with 'Access'
are you using the correct key
yes
hmm
even when copy pasting that code and just swapping the player name to mine and swapping the key it still gives that error
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".```
that’s a copy paste
even when adding nothing but lua Admin = _G.Adonis.Access("(my access key)", "Admin") to a script it produces the error
of course with the my access key being swapped out and without the parentheses
the access key has been erroring for a while :p
yea
fix!!!!
lol no

@cold stream do you know why
ok so is the problem just something with the access key in adonis being messed up or am I understanding this wrong
No, I don't know why, but you shouldnt be using that anyways
Make a plugin that creates a bindable for the function you want to use
That’s just a weird overly complicated workaround
Maybe the core access needs to be enabled?
not very experienced with adonis so correct me if im wrong
id rather use a remote to give people admin instead of using the global
return function(Vargs)
local server = Vargs.Server
local service = Vargs.Service
local Admin = server.Admin
local Commands = server.Commands
local Functions = server.Functions
local Remote = server.Remote
game:GetService("ServerStorage"):WaitForChild('ServerEvents'):WaitForChild("AddAdmin").Event:Connect(function(p)
--your code idk
end)
end
using BindableEvent