please tell me how to prohibit some ranks from using all? I’m afraid for the safety of the game that the administration may prescribe :kick all :kill all :respawn all, etc
if statement perhaps? I will need an image of the code to help further.
notice that the system has given permission levels for certain ranks, can you also give an image of the if statement for the kick all function, the kick function, and the respawn function if there is one (I would assume there is but I want to make sure)?
I didn’t write to the helper’s rights :kick all but Adonis allowed it
Can you explain further? I only wish to see the part of the code where Adonis calls the kick all function, can you show me the code for that as well?
Yes, I will send you the entire code in a private message
This should only be possible if you have the Adonis MainModule.
In the main module script, go to the Functions module (image attached)
From there, open it and go to the PlayerFinders table (without edits, should be line 37); and find the ‘all’ selector. Edit the function to include this code snippet at the beginning:
if Admin.GetLevel(plr) < DESIRED_LEVEL_HERE then
return
end
Replace DESIRED_LEVEL_HERE with the level that should be able to use the selector “all”.
Code Explanation
if Admin.GetLevel(plr) < DESIRED_LEVEL_HERE then
Starts an if statement using the GetLevel function inside the Admin variable (which is a ModuleScript includes multiple functions for the admin) and compares it to the provided level number using the less operator.
return
Returns nothing to the code calling the function (essentially ending the function without running the rest of the code).
end
Ends the if statement
Important note: do not keep a copy of the whole MainModule in your game just for making these changes; it will prevent automatic updates to the rest of Adonis. Loader plugins are where you can override such functions without forking the MainModule in its entirety. There is an example plugin in Adonis_Loader.Config.Plugins
to show how things are done.