Game Development Reference
If the condition in the brackets equates to TRUE , the script commands
immediately after the If statement will run. If FALSE , the script commands
immediately after the Else statement will run. The Else statement is
Multiple If statements can be nested to create an ElseIf condition.
The condition must be in brackets.
This scripts tests the Action and X position of a Toon called player with
respect to a Toon called ball , and either kicks or throws the Toon ball
Set playerAction = Get Property (player, action)
Set xdistance = Get Property (player, x) - Get Property (ball, x)
If ((playerAction = kick) and (xdistance < 1))
Set Property (ball, action) = kick
If ((playerAction = throw) and (xdistance < 1.5))
Set Property (ball, action) = throw
Detecting key presses
TScripts supports detection of key presses and left and right mouse
button clicks, using the Key command:
Key ( keycode ) <key>
' script commands to run upon keypress
The keypress argument is the keycode of the key, or mouse button, being
detected. The <key> is the actual key or mouse button pressed and must
be entered in the script by using the Keycode Button as follows:
1 Position the cursor in the script position where you want the Key
2 Press the Keycode Button.
3 Hit the key or mouse button you wish to detect.