there are 2 ways you can come from, and 2 ways you can leave from the crossing. and i have the following script
Code: Select all
main:
exec global/ai.scr
exec global/loadout.scr maps/test_truckmove.scr
exec gloal/friendly.scr
level waittill prespawn
exec global/ambient.scr test_truckmove
level waittill spawn
level.script = "maps test_vehicle.scr"
thread truck
end
truck:
$truck1 drive $t1 //$truck1 = the truck, $t1 = waypoint 1
thread truckcross
end
truckcross:
crossdirnames[1][1] = $t64 // entering direction 1, leave dir. 1
crossdirnames[1][2] = $t67 // entering direction 1, leave dir. 2
crossdirnames[2][1] = $t61 // entering direction 2, leave dir. 1
crossdirnames[2][2] = $t30 // entering direction 2, leave dir, 2
while (1) {
$truck waittil drive
crossdirnew = randomint (2)
$truck drive crossdirnames[crossdirnew][crossdirold]
crossdirold = crossdirnew
}
end


