How to unban yourself...? Yeah I know it's stupid

Do I just paste it in and swap the user with mine?

1 Like

Thank you friend, solved. I appreciate it everyone who helped.

2 Likes

By the way, make sure to check if the player who fired the RemoteEvent has enough authority to ban people. Otherwise, exploiters.

3 Likes

Oh thanks for reminding me, I completely forget some people devote their lives to hacking in a lego game and will find vulnerabilities.

2 Likes

I also recommend to use table.find. The function also goes through all indexes of the table, however the function I mentioned is written in C and is more optimized.

Also, if you want to keep the for loop you have, you can use the break statement after you cloned and reparented the ban UI. This will cause the loop to stop. You do not need to cycle through all the admins’ IDs if you found out the player was the 2nd admin in the list!

Finally, you can use the game:GetService("RunService"):IsStudio(). This could help you in developing your admin panel, without having to issue real punishments, as shown here:

if RunService:IsStudio() then
    print("Banned " .. target.UserId ) --Assuming target is of type Player

else
    --Issue a real ban
end

This would make it so that you don’t ban yourself (or anyone else) for testing.

Either way, I wish you good luck.

1 Like

Thanks man, yeah getting yourself banned is kind of embarrassing but hey, we all start somewhere with coding I guess.

You may consider to add a sort-of whitelist (an admin banning another admin should not be possible).

I honestly could have made the mistake. We all did something similar at some point, that’s normal!

Yeah that’s probably a good idea, I should think more about exploiters and admin abusers, I’m wayy too trusting of people sometimes lol, anyways thanks for the help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.