#Looking for a way to only run skript trigger when a player HAS teleported

1 messages · Page 1 of 1 (latest)

lucid void
#

I'm trying to make my own payment system with skript when teleporting using /home or /tpa. But the issue is, that there's a 3 second delay from typing /home till teleporting where you cannot move or it will be cancelled. Therefore the skript only has to run when the player successfully teleported, but I don't know how to check for that. Any ideas?

marble wasp
#

Show code?

lucid void
#
    cancel event
    loop items within player's inventory:
        if name of loop-item is "&2Polet":
            set {_poletamount} to amount of loop-item in player's inventory
            if {_poletamount} is greater than 0:
                make console execute command "lp user %player% permission set essentials.home true"
                wait 0.1 seconds
                make player execute command "essentials:home"
                wait 0.1 seconds
                make console execute command "lp user %player% permission set essentials.home false"
                make console execute command "cui take %player% polet 1"
        else:
            send "&cDu har ikke nogen poletter"
        stop loop

Well this the code I have that successfully looks for- and charges an item when using /home, but I don't know how to work around the teleport delay in case it gets cancelled

marble wasp