Scripting Guide - Show Playtime Script


This script will display the total playtime for a player in minutes




  • First, you will need to create a script that adds to users playtime

    ex - "/god editscript playtime"

    Enter this code:

    Sub Main()
    Dim Loop As Long

    For Loop = 1 To GetMaxUsers()
             If IsPlaying(Loop) = True Then
             SetPlayerFlag(Loop,667,GetPlayerFlag(Loop,667)+1)
             End If
         Next Loop

    End Sub




  • Next, you will need to make it so that the Playtime script runs every minute

    ex - "/god editscript minutetimer"

    Enter this code:

    runscript0("Playtime")



  • Then, you will need to make it so that playtime displays when a player types "/playtime"

    ex - "/god editscript command"

    Enter this code:

    Case "playtime"
         RunScript0("SHOWPLAYTIME")




  • Last, you will need to create the ShowPlaytime Script

    ex - "/god editscript showplaytime"

    Enter this code:

    Sub Main(Player As Long)
    Dim Days As Long, Hours As Long, Minutes As Long, Flag As Long

    Flag = GetPlayerFlag(Player, 667)

    PlayerMessage(Player, "You've played: " + str(Flag) + " minutes.", White)
    End Sub








    *Submitted by Jamie Ryan