;Alan's drag race script. ;This script will make two people 'race' against each other. ;Put the following script in a 'Start Race'spot. ;Put animation pictures in the door to control a 'start' light: ON ENTER { racing GLOBAL 0 racing = "To race, move to the start of the track and click on the lights." LOCALMSG "To race again, click on the lights." LOCALMSG "To stop racing, move to one of the grandstands." LOCALMSG } ON SELECT { racing GLOBAL ";racersready" SAY ; 0 ME SETSPOTSTATE 60 ME SETALARM } ON ALARM { 4 nbrpictures = { ME GETSPOTSTATE 1 + ME SETSPOTSTATE 60 ME SETALARM } { ";startrace" SAY } ME GETSPOTSTATE nbrpictures 1 - < IFELSE } ;Put this script in a spot at the start of lane 1 ON INCHAT { iwon GLOBAL racing GLOBAL { startx GLOBAL starty GLOBAL startx starty SETPOS } CHATSTR ";racersready" == racing AND IF ; { speed GLOBAL 20 5 RANDOM + speed = ; step GLOBAL steps GLOBAL 0 step = 20 steps = ; 0 iwon = lane1 GLOBAL 30 RANDOM ME SETALARM } CHATSTR ";startrace" == racing AND IF ; { 1 iwon = } CHATSTR "I won" GREPSTR IF } ON SELECT { racing GLOBAL 1 racing = ; startx GLOBAL starty GLOBAL stopx GLOBAL stopy GLOBAL ;***** 70 startx = 340 starty = 190 stopx = 200 stopy = ;***** startx starty SETPOS } ON ALARM { iwon GLOBAL speed GLOBAL startx GLOBAL starty GLOBAL stopx GLOBAL stopy GLOBAL step GLOBAL steps GLOBAL ;***** ;***** stopx startx - steps / deltax = stopy starty - steps / deltay = { startx deltax step * + starty deltay step * + SETPOS step ++ speed ME SETALARM } { { "!I won!" SAY } { ":Damn" SAY } iwon NOT IFELSE } step steps <= IFELSE } ;Put this script in a spot at the start of lane 2 ON SELECT { racing GLOBAL 1 racing = ; startx GLOBAL starty GLOBAL stopx GLOBAL stopy GLOBAL ;***** 460 startx = 340 starty = 330 stopx = 200 stopy = ;***** startx starty SETPOS } ;Put this script in doors on the sidelines. ;When people move here they will stop racing ON SELECT { racing GLOBAL 0 racing = }