Jump to content

Recommended Posts

Posted

I am trying to make an activator that teleports the player to an XMarker. I have written this simple script.

 

Scn StoneTeleport

 

short triggered

 

Begin OnActivate

 

if triggered = 1

MoveToMarker LooseStone01

set triggered 0

endif

 

end

 

When I hit save, I get the message "line 7, expression error: SYNTAX"

 

Can someone tell me why?

Posted

You forgot a "=" on line 7. :)

 

An easy fix:

Scn StoneTeleport

short triggered

Begin OnActivate

if triggered == 1
MoveToMarker LooseStone01
set triggered 0
endif

end

 

[EDIT]Oh, you're trying to move the player, right? What you've got now will move the activator instead of the player because you haven't put a reference in the MoveTo command. It should be like this:

Scn StoneTeleport

Begin OnActivate

if IsActionRef player == 1
PlayerRef.MoveToMarker LooseStone01
endif

end

The IsActionRef check makes sure the player isn't moved if an NPC activates the thing. And why the triggered variable?

  • Recently Browsing   0 members

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