How to make temporary ban?

You’re misinformed my guy. :slight_smile:
I ran a test now on 2 one-player servers with the server changing a textlabel representing the current tick() in minutes.

2 Likes

That’s because it’s returning the timezone that your computer’s in (because you’re the host). If the server was hosted somewhere else it would return that country’s timezone in relation to the UNIX Epoch. Correct me if I’m wrong.

1 Like

Entirely wrong. This is run on two different Roblox servers with 1 players max in each. And as I said, the server is changing the textlabel based on tick().

1 Like

No, what he’s saying is that your computer and that server you are representing tick() in is run on your local time zone, if that be EST, BST, PST, whatever it is. If another player from a different time zone from your time zone, joins the game, the tick() would be different, because tick() does not revolve around UTC, it is based off your time zone. Os.time is the one that goes based off of UTC, and no matter where you are in the world, UTC will not change, whereas tick changes to the timezone of the player with the server.

1 Like

This is wrong. Yet again read what I said. No offense. :slight_smile:

Quote:

I understand, and I know that textlabel won’t change since the server is changing it. But in relation to the post and the ban time, that will fluctuate based on where the person lives, and where the person who handed out the ban lives.

Assuming the client would attempt to connect to the closest server, if you’re running both clients from the same general location they would both connect to the nearest server, which would return the same value.

No. Due to the fact that AFAIK Roblox’s servers are based in america and is not hosted by any of the players.

Uh, I don’t understand, so do I use tick() or no :laughing:

Tick() is completely fine to use. These fellas seemingly don’t understand what I mean when I state things like these.

Do not use tick(), it returns a “local” time depinding of the time on your computer, therefore the player can bypass the ban. I would recommend using os.time() instead.

(To be fair os.time() works just like tick() but instead of a local time it returns time based on a timezone so I dont think it would be such a problem to use it instead)

This is wrong. How can you state these things without any kind of proof? Yet again my statements are related to the server, not the client. Therefore your computer has no say in what tick() returns.

As I said it returns a local time, the date and time in your computer can be changed. Try changing it and then play and then use other computer just like how you did but with the current time.

There is a tremendous difference between using tick() on the server vs the client. Client is local, server is not. That’s not hard to understand and has been my point all along.

Tick returns local time. If you read the Luau recap, it returns “a variant of the UNIX timestamp in local time”, or in this case the server’s timezone. And if you still think that’s not a valid reason, it’s also going to be deprecated sometime in the future. Luau Recap: June 2020

1 Like

Building off from the article you linked, it states this

tick() sounds perfect - it has a high resolution (usually around 1 microsecond), and a well-defined baseline - it counts since UNIX epoch! Or, well, it actually doesn’t. On Windows, it returns you a variant of the UNIX timestamp in local time zone. In addition, it can be off by 1 second from the actual, real UNIX timestamp, and might have other idiosyncrasies on non-Windows platforms.

Even if what you might have said about running it on the server, this clearly shows it is not as reliable and one might seem.

1 Like

Oh yeah I just went to search more about tick() and os.time() differences and the only difference that I noticed was of it returning time and including miliseconds.

But I mean, os.time() would do the same thing in this case… I recommend it because of the fact you can use it to check days, months without needing to calculate how many seconds passes between each one which could make the temp ban system a quite more easier.

I am not wrong. The clients are connected to the same server.

Players can connect to a server with hours difference therefore tick() would return the amount of seconds from the UNIX epoch relative to the server time. So the ban would expire earlier or later.

You should be able to accept that you aren’t correct here

Please follow the guidelines before posting: About the Scripting Support category