Core Module - Sudo - An extention of task and token to allow a single require to register and run functions bypassing all permissions.
-- To use sudo you must register the allowed functions when the files are loaded, often this will just be giving access to
-- some functions within a module if you expect that some parts may be blocked by in game permissions or a custom system you have made
-- This will be blocked if the current player (from a command or gui) is not admin
local function make_admin(player)
player.admin = true
end
-- Here we give sudo access to the function under the name "make-admin"
Sudo.register('make-admin',make_admin)
-- This will allow us to bypass this by running one tick later outside of any player scope
Sudo.run('make-admin',game.player)
utils.task |
utils.token |
register(name, callback) | Registers a new callback under the given name, used to avoid desyncs |
get(name) | Gets the function that is registered under the given name |
run(name[, ...]) | Runs the function that is registered under the given name, you may supply any number of params as needed |
Registers a new callback under the given name, used to avoid desyncs
Parameters:Gets the function that is registered under the given name
Parameters:Runs the function that is registered under the given name, you may supply any number of params as needed
Parameters: