Hello everyone, I have come up with an example of a really cool use for the new relative coordinate options coming in the 2.22 update.
This is a directional teleport that is triggered by equiping, Then Dequiping an item.
Here are the scripts.
IsEquipped [*Left] [TeleportKey] [True]
HasHistory [Teleporting] [Player] [False]
// Checks if the player is holding the teleport key item, And does not have a history of "Teleporting" Which wil be explained later.
History [Teleporting] [Player]
IsEquipped [*Left] [TeleportKey] [False]
HasHistory [Teleporting] [Player] [True]
// Checks if the player is not holding the teleport key, And has a history of "Teleporting" This is used to check if the player dequips the teleport key
Teleport [Player] [vrel:10,0,0]
History [Teleporting] [Player] [Clear]
// Teleports the player 10 metres forwards, And clears their teleporting history.
// You can reduce the wait time, I just have it at 1 second to be forgiving to players who scroll across the key quickly to get to other items
When either script is run for the player, It will start the loop, And allow them the ability to teleport in any direction 10 metres when using the key item.
Note: IsEquipped allows for much smoother magic systems then the previous book system, I'd highly recommend it for any magic systems that you may use in your maps.