Help with request system

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

    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.

Jqckk

Member
Apr 28, 2020
3
0
0
19
I'm working on my tpa system and have made a lot of progress, but I've run into an issue.
Code:
command /tpa <player>:
    description: Request to teleport to a player
    trigger:
        if arg-1 is online:
            send "%player% would like to teleport to you, do /tpaccept to accept" to arg 1
            send "Sending a teleport request to %arg 1%" to player
            loop 10 times:
                if {%arg-1%.accept}:
                    send "Request accepted!" to player
                wait 1 seconds
            send "Teleport request expired" to player
        else:
            send "That player is not online" to player
command /tpaccept:
    description: Accept a teleport request
    trigger:
        loop 10 times:
            set {%player%.accept} to true
            wait 1 seconds
        set {%player%.accept} to false
On line 8 it says that "can't understand this condition '{%arg-1%.accept}'" What that line it supposed to do is check if the variable {"Player the Player wants to teleport to".accept} is true, but it seems I can't do that by just inserting %arg-1%. Help would be appreciated.
 
I think you forgot to put "true" in the code :emoji_wink:

this should do the trick
Code:
command /tpa <player>:
    description: Request to teleport to a player
    trigger:
        if arg-1 is online:
            send "%player% would like to teleport to you, do /tpaccept to accept" to arg 1
            send "Sending a teleport request to %arg 1%" to player
            loop 10 times:
                if {%arg-1%.accept} is true:
                    send "Request accepted!" to player
                wait 1 seconds
            send "Teleport request expired" to player
        else:
            send "That player is not online" to player
command /tpaccept:
    description: Accept a teleport request
    trigger:
        loop 10 times:
            set {%player%.accept} to true
            wait 1 seconds
        set {%player%.accept} to false
 
Status
Not open for further replies.