Guild System, issues

  • 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.

AlexWarrior

Member
Dec 5, 2020
14
0
1
34
Hello! So I am currently working on a guild system. Basically, users can create a guild and invite their friends. I having some issues however.

I have a couple variables:
{guilds::WhatGuild::*} - Explains what guild a user is in
{guilds::InGuild::*} - Boolean on whether a play is in a guild

Code:
command /guild [<text>] [<player>]:
    trigger:
        if arg-1 is "invite":
            if arg-2 is set:
                if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:

                    add arg-2 to {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::InviteList::*}
                    send "&bYou have invited &3%arg-2% &bto the guild!"
                    send "&0" to arg-2
                    send "&bYou were invited to the Guild &6%{guilds::WhatGuild::%player's uuid%}%&b! Type &7/accept %{guilds::WhatGuild::%player's uuid%}%" to arg-2
                    send "&0" to arg-2
                else:
                    send "&cYou are not the leader of this guild"
           
        else if arg-1 is "kick":
            if arg-2 is set:
                if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:
                    remove arg-2's uuid from {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}
                    delete {guilds::WhatGuild::%arg-2's uuid%}
                    delete {guilds::InGuild::%arg-2's uuid%}
                    send "&bYou have kicked &3%arg-2% &bfrom your guild!"

                else:
                    send "&cYou are not the leader of this guild"
       
        else if arg-1 is "create":
            if {guilds::WhatGuild::%player's uuid%} is not set:
                set {guilds::CreatingGuildName::%player's uuid%} to true
                send "&bType in chat the name you want your guild to be! Type cancel to stop"

            else:
                send "&cYou are already in a guild!"
       
        else if arg-1 is "disband":
            broadcast "%{guilds::WhatGuild::%player's uuid%}%"
            broadcast "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader} parsed as player%"
            if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:
                send "&cDisbanding, please wait."
                wait 1 second
                loop {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}:
                    wait 1 tick
                    send "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::%loop-value%}%"
                    send "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
                    delete {guilds::WhatGuild::%loop-value%}
                    delete {guilds::InGuild::%loop-value%}
                broadcast "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
                delete {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}
                send "&cGuild disbanded"
            else:
                send "&cYou are not the leader of this guild, if you are trying to leave do /guild leave"
       
        else if arg-1 is "list":
            send "debug %{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
            send "Leader: %{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}%"
            loop {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}:
                set {_player} to loop-value parsed as player
                send "%{_player}%"
           
        else:
            send "&0&m------------------------------------"
            send "&b&lGuild Commands:"
            send "&7- &f/guild create &7Start the guild creation process"
            send "&7- &f/guild invite <player> &7Invite a player to your guild"
            send "&7- &f/guild kick <player> &7Kick a player from your guild"
            send "&7- &f/guild list &7Show the members of your guild"
            send "&7- &f/guild disband &7Disband your guild"
            send "&7- &f/guild leave &7Leave your current guild"
            send "&7- &f/accept <guild name> &7Accept a Guild Invite"
            send "&0&m------------------------------------"

on chat:
    if {guilds::CreatingGuildName::%player's uuid%} is true:
        cancel event
        set {guilds::CreatingGuildName::%player's uuid%} to false

        set {_message} to message

        if message contains "cancel":
            send "&cCanceled the guild creation process" to player
            stop
           
        if length of {_message} < 3:
            send "&cThe name must me equal to or more than 3 characters" to player
            stop
        if length of {_message} > 10:
            send "&cThe name must me equal to or less than 10 characters" to player
            stop
       
        if {guilds::Guilds::*} contains {_message}:
            send "&cThat guild name is already taken" to player
            stop
       
        add "%{_message}%" to {guilds::Guilds::*}
        add player's uuid to {guilds::InGuild::*}
        set {guilds::Guilds::%{_message}%::Leader} to player's uuid
        set {guilds::WhatGuild::%player's uuid%} to {_message}

        send "&bYou have created the Guild &3%{_message}%!" to player

command /accept [<text>]:
    trigger:
        if arg-1 is set:
            if {guilds::Guilds::%arg-1%::InviteList::*} contains player:
                remove player from {guilds::Guilds::%arg-1%::InviteList::*}
                add player's uuid to {guilds::Guilds::%arg-1%::Members::*}
                add player's uuid to {guilds::InGuild::*}
                set {guilds::WhatGuild::%player's uuid%} to arg-1

                send "&bYou have joined &6%arg-1%"

            else:
                send "&cYou dont have a active invite to this guild!"

# Debug

command /deleteguilds:
    permission: op
    trigger:
        clear {guilds::*}
        send "Deleted"

The /deleteguilds command is to redo testing.

Basically my issue is:
Players create a guild and invite their friend, however, when they disband the guild and do /guild list, it shows that all users are still in a guild and none of the delete syntaxes worked.

Skript Ver: 2.6.1
Server: 1.8.8 (I dont want any bs about this version)

Note: Some broadcasts are just for debugging

Please let me know if you need anymore information.
[doublepost=1653505171,1653336047][/doublepost]Still having issues
[doublepost=1653602733][/doublepost]Still having issues
 
No matter how much you dislike people telling you that the problem may be your version, skript 2.6.1 isn't really meant to be used on 1.8, there are versions for 1.8, using 1.8 for pvp is probably the stupidest thing ever since you can turn 1.9 pvp into 1.8 pvp easily which is why i hope you have a better excuse.
I won't help in this thread until a further reply about this.
 
No matter how much you dislike people telling you that the problem may be your version, skript 2.6.1 isn't really meant to be used on 1.8, there are versions for 1.8, using 1.8 for pvp is probably the stupidest thing ever since you can turn 1.9 pvp into 1.8 pvp easily which is why i hope you have a better excuse.
I won't help in this thread until a further reply about this.
You literally had no reason to say this. I'm done with skript as I believe I have enough knowledge with java now and most of the time I ask for help related to skript I get this crap.

Posting on a thread for a complete bs reason is ridiculous. If you don't want to help don't say anything.

1.8 is the superior version for pvp. You cant turn 1.9 pvp into 1.8 easily so I don't know what your talking about.

Edit: 2.6.1 is the version it gives you on the discord when you ask for a 1.8 version of skript
 
Status
Not open for further replies.