Solved Movement detection not working

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

plantje17

New Member
Aug 11, 2019
6
2
0
23
I'm writing a script that teleports players when they stand on a beacon, and cancels the teleportation when they move while standing on it. I've tried many expression to detect such movement ('on any movement', 'on walk over beacon', 'on move on beacon'...), but whatever expression I use, the server always returns an error while reloading the plugins: [Server thread/ERROR can't understand this condition: 'on walk over beacon']. Any idea what causes this or how to fix it?

Code:
entering region "tpn":
    if {tpcooldown} is 1:   
        stop
    else:
        play sound "block_beacon_activate"
        message "&7Move to cancel teleportation"
        on walk over beacon:
            play sound "block_beacon_deactivate"
            message "&4Teleportation cancelled"
            stop
 
I'm writing a script that teleports players when they stand on a beacon, and cancels the teleportation when they move while standing on it. I've tried many expression to detect such movement ('on any movement', 'on walk over beacon', 'on move on beacon'...), but whatever expression I use, the server always returns an error while reloading the plugins: [Server thread/ERROR can't understand this condition: 'on walk over beacon']. Any idea what causes this or how to fix it?

Code:
entering region "tpn":
    if {tpcooldown} is 1:  
        stop
    else:
        play sound "block_beacon_activate"
        message "&7Move to cancel teleportation"
        on walk over beacon:
            play sound "block_beacon_deactivate"
            message "&4Teleportation cancelled"
            stop
its because "on walk on" is an event, and you are using it like a condition
 
I see, but how do I change it then? Do I have to use an 'if' statement somehow?
it's an event, so you need to use it outside a trigger
Code:
entering region "tpn":
    if {tpcooldown} is not set:
        stop
    else:
        play sound "block_beacon_activate"
        message "&7Move to cancel teleportation"
on walk over beacon:
  {tpcooldown} is set
  play sound "block_beacon_deactivate"
  message "&4Teleportation cancelled"
  delete {tpcooldown}
like that
 
Status
Not open for further replies.