Prohibition of rank rights [Adonis]

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

1 Like

if statement perhaps? I will need an image of the code to help further.

1 Like

1 Like

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)?

1 Like

image
I didn’t write to the helper’s rights :kick all but Adonis allowed it

1 Like

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

1 Like

This should only be possible if you have the Adonis MainModule.

In the main module script, go to the Functions module (image attached)

image

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

1 Like

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.