# How to increment an object property, later i check it and disable itself if date/year mismatches

I'm writing some code,to get the year, then check it during my load screen. If it's not 2017,I want the game object to destroy itself.. it will be a version of the game I give to friends for testing..So next year when I'm hopefully selling the game, it wont work for these test builds. Here's my code,somethings wrong, I usually don't code in python. I thought this would work. The object has an int property called dateok. It has another sensor to check dateok and destroy itself if the value is 1;

import datetime
import bge

cont = bge.logic.getCurrentController()

def main():

if day.year!=2017:

owner = cont.owner
dateok = cont.actuators['dateok']
value = value.get(dateok.propname) +1
dateok.value = str(value)
cont.activate(dateok)


## 2 Answers

I suggest you check the current date:

from datetime import datetime

if datetime.now().year>2017:
...

import datetime

import bge

cont = bge.logic.getcurrentController()

if datetime.datetime.now() > datetime.datetime(2018,1,1,1):

ownwer = cont.owner
owner["property"] +=1


I figured it out..thanks anyways guys