Simple python question

Sorry for all the questions. But I can’t find it. :no:

I have a timer property. And I want a action to play when that property is between a certain number.

I tried:

own = cont.getOwner()
Prop = own.prop

if Prop > 3():
play action

But I get the error: INT object is not callable.

Someone please help. :slight_smile:

Hi,

try this :


own = cont.owner
prop = own["timer"]

if prop > 30:
      play action

Don’t forget the “” around the name of your property in own[timer]

Still the same error

edit

O, no. I get error: key “timer” does not exist

Damn… I always get that… Try it in another blend file and it works :stuck_out_tongue: thanks man

edit

Check below

Damn… When I put in your python it works… But when I do it like this it doesn’t work…

if prop > 3.05() and prop < 4999():
GameLogic.addActiveActuator(ride, True)
else:
GameLogic.addActiveActuator(ride, False)

It sais FLOAT object is not callable

Sorry man, I’m getting sick of blender… Retyped the whole thing and it works.

Thanks a lot =]