Author Topic: value always returns false? [SOLVED]  (Read 2726 times)

Perfect! The server command works, thank you! I will also be sure to return a value from now on. Thank you for your help!

Also a small thing
In your original function in the op you don't return any value, and then compare it to false
Although torque will allow this, and interpret null (if torque even calls it null) as false, it's still good practice to return false instead of nothing
Most other languages will explode if you try to do this

TorqueScript functions don't return null by default, they return the last value referenced as a result of something else.

==>function foo() { %x = "hello"; }
==>echo(foo());
hello

TorqueScript functions don't return null by default, they return the last value referenced as a result of something else.

==>function foo() { %x = "hello"; }
==>echo(foo());
hello

I mean he just does return; (inside the if block in activate) when he's then trying to check the value returned.
Either way, it's bad practice and it won't work in other languages