Scripting Guide - Pushback Script


This script will push players 1 space down, when called by an event




  • First, you will need to open the pushback script

    ex - "/god editscript pushback"

    Once you get the event opened, enter this code:

    Function Main(Player as Long) as Long
    Dim Direction as Long, PMap as Long, PX as Long, PY as Long

    PMap = GetPlayerMap(Player)
    PX = GetPlayerX(Player)
    PY = GetPlayerY(Player)
    Direction = GetPlayerDirection(Player)

    Select Case Direction
    Case 0
         PlayerWarp(Player, PMap, PX, PY + 1)
    Case 1
         PlayerWarp(Player, PMap, PX, PY - 1)
    Case 2
         PlayerWarp(Player, PMap, PX + 1, PY)
    Case 3
         PlayerWarp(Player, PMap, PX - 1, PY)
    End Select

    End Function


  • Now, the script can be called upon by entering this in an event:

    RunScript0("Pushback")