This might seem confusing but hopefully you can understand.
Lets say we have a table called bannedplayers
.
local bannedplayers = {"bannedplayer1", "bannedplayer2", "someone"}
It could be an empty table or no. Now let say we also have an admin gui which only admins can access. They can ban, kick people for hours, days, week, months, years. Once that code executes it will create a new index in the bannedplayers
table. If the player got banned for a week. He will stay inside that list for a week and he will get removed. Or if that is too complicated we can just create new tables with the time of the ban. For example a table called bannedplayers4aweek
.
The thing is that this shall be done without shutting down the severs. And I do not think that is possible but with HttpServices
it can be. I have seen this before in a game called CB:RO.
I am not asking for script ofc but how could this be done? I just want to get some ideas.
This is my thinking of a way it should be done, not the absolute way.
First I think you need to know how table dictionary work:
local bannedplayers = { ["bannedplayer1"] = VALUE, ["bannedplayer2" = VALUE, ["someone"] = VALUE }
What I am thinking is does VALUEs are replaced with UNIX time (using tick() ):
When the ADMIN ban a player for some amount of days, or so, you can calculate how much seconds is in those amount of days (7 Days = 604800).
Then, adds player name to the table, and the key being the amount of seconds in those days plus the time now: bannedplayers[player.Name] = tick() + timeBannedInSeconds
, then save that into data storing place.
When a player joins: