1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Adding a delay to existing commands

Discussion in 'Development' started by Kabluinc, Aug 25, 2019.

  1. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    Hi, is there a way for me to add an execution delay to existing commands in a specific level?

    For example, if a player is in the world 'factions', and they run commands such as /f home, /warp, /tp etc, there will be a delay (ex 5 seconds) before the command executes and tp's them.

    That way, players cannot abuse these commands while in combat
     
  2. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    use PocketMine task
     
  3. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Even better: Just save the Time for each player when they last used the command.
     
    SleepSpace9 likes this.
  4. benda95280

    benda95280 Witch

    Messages:
    53
    GitHub:
    benda95280
    Should it be possible to intercept the command, check if the command is '/f home", if yes, create a task and run it in 5 seconds (as the player) ?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.