ChangeRoom(Current room) + 1

Started by arj0n, Tue 06/07/2010 12:48:59

Previous topic - Next topic

arj0n

I'd like to have the playercharacter goto to the next room when the timer is expired.
Say I have 10 room and the player starts in room1.
After the timer has expired, the player should automatically go to room2.
After the timer has expired again, the player should automatically go to room3. And so on.
There should also be a check for the maximum room number [room 10 for now],
in order to quit the auto-change.room.

I tried:
function repeatedly_execute() {
if (IsTimerExpired(1)) player.ChangeRoom(cEgo.Room) + 1)

Which results in an error: GlobalScript.asc(74): Error (line 74): Parse error in expr near '1'

[I tried to achieve: changeroom('currentroom') + 1. Which doesn't seem to be ok]

Gilbert

if (IsTimerExpired(1)) player.ChangeRoom(player.Room+1) ;

SMF spam blocked by CleanTalk