Do I just paste it in and swap the user with mine?
Thank you friend, solved. I appreciate it everyone who helped.
By the way, make sure to check if the player who fired the RemoteEvent has enough authority to ban people. Otherwise, exploiters.
Oh thanks for reminding me, I completely forget some people devote their lives to hacking in a lego game and will find vulnerabilities.
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.
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.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.