Join / Leave Logs (incl. time tracker)

Greetings. I am trying to create a script that will log how long each player has been in the game and how long the server is playing.

The issue is, I am an intermediate scripter, and spent time researching in mostly anti-exploit scripts and webhooks. So, if you could help me out, would really appreciate it.

Here’s an example of what it is supposed to look like:
https://gyazo.com/7a633e7c93643158c881e71ec9265432

elapsedTime and second argument of wait()

There’s no way this is going to be exploited as you need to deal with it on the server

To check whether a server was just made you can check the DistributedGameTime , if it’s only been a few seconds or minutes you can easily tell if the server is new

To track when a player joined a game you need to use the PlayerAdded event.

To track when a player leaves a game you need to use the PlayerRemoving event.

To track when a server shuts down you can use the BindToClose event.

Lastly to track the exact time a player stayed in the server can be achieved using tick()

local JoinTime = tick()

function PlayerLeaving()
   local elapsedtime = tick() - JoinTime

   --Fire it from your webhook
end
1 Like