Unwanted NaN value

I’ve recently been working on a money, heat and etc calculator for my game. Except, when I place a solar panel next to a generator, it starts making money, but when I bring an item or unit close, my money turns to NaN and thus, the engine doesn’t change it, even after keeping distance from the units.
Game link: http://www.modd.io/play/B3hfs2vbL

Even tho I tried to prevent this, the math still gives out a NaN. (Notice: “owner of selected unit” is an entity variable)

4 Likes

same i also use a script that adds your money but renders me paralyzed and my points are down to NaN i use:

increase points

Triggers:

actions

if (( @Admin contains ( ( owner of ( triggering unit ) ) 's name ) )) == (true)

then do:

add 500 to points :smiley: only adminset Points of ( owner of ( triggering unit ) ) as (( Points of ( selected player ) ) + (500))

else do:

3 Likes

try this : create a script without trigger called “points for admin” after youput this script : set poits of player or unit of last casting unit as point of last casting unit or player + 10000 and then create a bility and finally you put this ability in a unit

3 Likes

2 Peoples talked of this,i no need talk. :v

3 Likes