#how to make a stop watch displaying in MM:SS:MSMS?
1 messages · Page 1 of 1 (latest)
look into datetime() and datastoreservice
local function formatTime(time)
local minutes = math.floor(time / 60)
local seconds = math.floor(time % 60)
local milliseconds = math.floor((time % 1) * 100)
return string.format("%02d:%02d.%02d", minutes, seconds, milliseconds)
end
The time variable is a tick() value
Used it in one of my games
chat gpt ah
ok i will
is this good
btw im running the timer both client and server side
the client side is just to display
and server side is so its not exploitable
server has final say btw
not really ngl
like ik what the other guy said
its not even about the formatting
its like how do i run both the client and server at the same time
depends if you want the same time for everyone or not
its different for everyone
In this case you could put everything in LocalScript then I guess
but that would make it easy for exploiters
to exploit and stuff
and that would be super bad for my game
should the chrono start when a player join?
you should put in the client the code that detect when this button is pressed and register the time when it is pressed, then remote the server
with Datetime.now()
and the duration of the timer you put it in the server script
show me your server side
Also this is the DateTime documentation if you need