Jump to content
  • 0

can someone help me with this script


achreshia

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  11/12/12
  • Last Seen:  

prontera,150,150,4    script    Party Recruiter    108,{
    mes "[Party Recruiter]";
    mes "Welcome to the 7v7 Party Recruiter!";
    mes "I can help you form a team for 7v7 matches!";
    mes "Do you want to join a team or create a new one?";
    
    switch(select("Join a Team","Create a Team","Cancel")) {
        case 1: // Join a team
            mes "[Party Recruiter]";
            mes "Let me find available teams for you.";
            callsub CheckAvailableTeams;
            close;
        case 2: // Create a team
            mes "[Party Recruiter]";
            mes "Let’s set up a new team!";
            if (getpartycount() > 0) {
                mes "You are already in a party!";
                close;
            }
            callsub CreateTeam;
            close;
        case 3: // Cancel
            mes "[Party Recruiter]";
            mes "Alright, let me know if you need help later!";
            close;
    }
    
OnInit:
    // Initialize waiting rooms
    set .team1_waitingroom, 0;
    set .team2_waitingroom, 0;
end;

CheckAvailableTeams:
    // Logic to show available teams
    if (.team1_waitingroom < 7) {
        mes "Team 1 has " + .team1_waitingroom + "/7 players.";
        next;
        if (select("Join Team 1") == 1) {
            if (.team1_waitingroom < 7) {
                warp "waitingroom1", 0, 0;
                ++.team1_waitingroom;
                set @team, 1;
                end;
            } else {
                mes "Sorry, Team 1 is full.";
                close;
            }
        }
    }

    if (.team2_waitingroom < 7) {
        mes "Team 2 has " + .team2_waitingroom + "/7 players.";
        next;
        if (select("Join Team 2") == 1) {
            if (.team2_waitingroom < 7) {
                warp "waitingroom2", 0, 0;
                ++.team2_waitingroom;
                set @team, 2;
                end;
            } else {
                mes "Sorry, Team 2 is full.";
                close;
            }
        }
    }

    mes "No available teams at the moment.";
    close;

CreateTeam:
    mes "Creating a new team requires 7 players.";
    mes "Once all 7 players are in the waiting room, the match can start.";
    mes "Do you want to create Team 1 or Team 2?";
    next;

    switch(select("Team 1","Team 2","Cancel")) {
        case 1:
            if (.team1_waitingroom > 0) {
                mes "Team 1 already exists.";
                close;
            }
            mes "Team 1 is now created!";
            set .team1_waitingroom, 1; // Include the leader
            warp "waitingroom1", 0, 0;
            end;
        case 2:
            if (.team2_waitingroom > 0) {
                mes "Team 2 already exists.";
                close;
            }
            mes "Team 2 is now created!";
            set .team2_waitingroom, 1; // Include the leader
            warp "waitingroom2", 0, 0;
            end;
        case 3:
            mes "Alright, let me know if you change your mind!";
            close;
    }
}

OnPCLogoutEvent:
    // Handle player leaving the waiting room
    if (@team == 1) {
        --.team1_waitingroom;
    } else if (@team == 2) {
        --.team2_waitingroom;
    }
    end;
 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   20
  • Joined:  12/24/18
  • Last Seen:  

Could you please explain what kind of help you need with this script? If there's an issue with it, could you describe the problem in more detail? It would be helpful if you could provide more specifics.

 

Would it be possible to use a code box when posting a script? This way, when the script is shared, there won’t be any confusion regarding spaces and tabbing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...