![]() |
The following example shows how a script can set a variable and call a routine in another script. The first script, called CarScript, declares the variable and defines the routine:
Dim CarNumber
Sub RunCar
If CarNumber = 1 Then
LittleEngineSound.Play
Else
BigEngineSound.Play
End If
End Sub
The second script calls into CarScript, which is referenced in its Script Content folder, to play an appropriate sound, as follows:
Sub StartRace
CarScript.CarNumber = 1
CarScript.RunCar
End Sub