Jump to content

Script help


Bennytheowl

Recommended Posts

It's gibberish to me because I don't understand the error.

 

I've literally just used the script provided with name changes.

 

scriptname OTWACScriptTravel1

int iButton

begin OnActivate
if IsActionRef Player ; only run if activated by the player
showmessage OTWACtravelBox ; message should contain buttons! they correspond with conditionds below.
endif
endif

begin menumode
set iButton to GetButtonPressed

if iButton == 0 ; if player pushes button#0
PlayerRef.Moveto OTWACMarker1REF ; player gets teleported to marker
endif

end

Link to comment
Share on other sites

A begin-block must always end with an accompanying end-statement. Tomm mistakenly ended the first begin-block with endif, which must be used only for ending an if-block.

 

Incorrect:

begin onActivate
    ; do stuff
endif

Correct:

begin onActivate
    ; do stuff
end

If you're wondering which ends/endifs goes with which begins/ifs, the rule is that any begin- or if-statement ends when the first end- or endif-statement is encountered. It also helps if the code is properly indented, as the examples here are.

Link to comment
Share on other sites

  • 4 weeks later...

A begin-block must always end with an accompanying end-statement. Tomm mistakenly ended the first begin-block with endif, which must be used only for ending an if-block.

 

Incorrect:

begin onActivate
    ; do stuff
endif

Correct:

begin onActivate
    ; do stuff
end

If you're wondering which ends/endifs goes with which begins/ifs, the rule is that any begin- or if-statement ends when the first end- or endif-statement is encountered. It also helps if the code is properly indented, as the examples here are.

Thanks

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...