Add :undex command to remove Dex from players, and hook the removal function to Server.Core.Admin.luau#1974
Conversation
Add a removal function & command, clean-up the style a bit and attach the removal function to the Functions list so that it can be used by the Server.Core.Admin module.
This will be called if both of these conditions were met: the Dex "internal plugin" is present in Server.Plugins (and loaded), and the unranked/demoted player is below rank 300 as the final result.
If the source player's rank is lower than the target's, reject with a hint. Basically a simple but needed permission system inside the command itself.
|
I think you should also add the ability for whoever has dex to remove it from themselves, regardless of rank. Preferably though dex itself. There could be a close button in that expandable top menu that dex has. |
Everyone who's able to run
The dex code style & structure is relatively more complex, and I don't think I can really add a new feature to Dex while keeping the consistency across the whole code. |
|
I kinda forgot dex doesn't have a player argument. I give non-admins dex sometimes using ;sudo. Will using sudo still work? |
Since |
|
It's been 6 months since the last time I've interacted with this PR and bumping this for a little bit of follow-up here. |
(Continuation of #1877)
This PR makes it so the Dex Explorer can be removed from the source player or a specified target player with
:undex,:removedex, or any other similar commands.This PR also includes a check for existing Dex_Client in PlayerGui when loading (and removes the old Dex_Client and related GUIs if found) to give the ability for players to refresh Dex in case something else happened.
Expected intended behavior
After executing
:undex(or other similar commands) to a player, or commands leading toAdmin.SetLevel(player)such as:unrankis called, every Dex-related GUIs (listed in Variables.DexNames) and the existing Dex_Client in the player's PlayerGui on the server are removed, alongside removing the player from the ServerNewDex.Authorized list for security reasons.Note that the target player must have the same rank / AdminLevel or lower than the user of the command to prevent misusage (e.g. someone with HeadAdmin uses this command against an experience owner).
Proof of functionality
Core PoF (Resetting the Dex GUI, executing the
:undexcommand itself, and also making sure the remote function still works):removedex_pof.mp4
Two-player PoF (Executing :undex alongside other players):
removedex_other_players_comp.mp4