How make an command to expire?

  • 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 community!

    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.

Yolopolo

Member
Sep 3, 2017
2
0
0
Hello, so I made a tpa skript, and i can't make tpa request to expire, best i got that i made one with loop but it would expire every 30 seconds and not 30 seconds after tpa was send. Help
 
it should work, didn't test it:
code_language.skript:
on join:
    set {%player%.tpahere} to false
    set {%player%.tpa} to false
command /tpahere <player>:
    aliases: /call, /tpask
    trigger:
        player doesn't have permission "essentials.tpahere":
            stop
        arg 1 is not set:
            message "Usage: /tpahere <player>"
        arg 1 is set:
            set {%arg 1%.tpahere} to sender
            message "%sender% wants you to teleport to him" to arg 1
            message "teleport request sent" to player
            wait 30 seconds
            set {%arg 1%.tpahere} to false
command /tpa <player>:
    trigger:
        player doesn't have permission "essentials.tpa":
            stop
        arg 1 is not set:
            message "Usage: /tpa <player>"
        arg 1 is set:
            set {%arg 1%.tpa} to sender
            message "%sender% wants him to teleport to you" to arg 1
            message "teleport request sent" to player
            wait 30 seconds
            set {%arg 1%.tpa} to false
command /tpaccept:
    aliases: /tpyes
    trigger:
        player doesn't have permission "essentials.tpaccept":
            stop
        {%player%.tpa} is false:
            {%player%.tpahere} is false
            message "you don't have any teleport request" to player
        {%player%.tpahere} is not false:
            teleport player to {%player%.tpahere}
            set {%player%.tpahere} to false
        yml value "tpa" of file "plugins/Essentials/userdata/%player%.yml" is not "false":
            teleport {%player%.tpa} to player
            set {%player%.tpa} to false
        set {_message} to "teleprot request accepted"
        message coloured {_message} to {%player%.tpa}
        message coloured {_message} to {%player%.tpahere}
        message coloured {_message} to player
        set {%player%.tpa} to false
        set {%player%.tpahere} to false
 
Thank you :emoji_slight_smile:
[doublepost=1504538398,1504437194][/doublepost]Hi, I tested it but it has an error :emoji_grinning:
 
Status
Not open for further replies.