Server Points System

Hello, I would like to create or adopt a system for my server! The system I am thinking of would take the “Time Played” from each player, and give them points for a certain increment of time. I was thinking maybe it would consist of connecting to gametracker and taking the “Time Played” from each player, and put it into a code such as :


var player = i //The player variable is the time played.
if (player= i + 1)

{give(player) 5 points 

}

else

{   console.log i

}

I am a total novice at javascript.lua, but i'm sure it would look something like this. Thanks. 

Would this also connect to an html? Please don’t tell me to figure it out myself. Help me as much as possible. I am wanting to learn, not steal a code.