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

help?

Discussion in 'Development' started by Zuruki, May 21, 2017.

  1. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    So. I have my func startDuel().
    I want players to /duel <player>. Then a request is sent to the other player. If they type /duel accept the function startDuel() executes.

    So, how can I execute the function on the condition that the other player types /duel accept <player>
    Use boolean object?
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    when the other player execute accept command calls accept since you dont need to check if the issuer accepted it anyways
     
  3. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    rephrase please man
     
  4. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    I would suggest creating a 2 dimensional array with a key for each player. When a player receives a duel request, add the requester's name to the target player's array. Then, when the target player tries to accept the request, you can check if the requester's name/identifier is in the target array. Also, boolean is a data type, not an object.
     
    Zuruki, Lowkey and jasonwynn10 like this.
  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.