Clan Skript Not Working with No errors

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

EpicLucas100

Member
Jun 6, 2020
10
0
1
I made a clan skript and it comes with no errors. im not using any dependencies just Skript. Does anyone know why? The thing that isnt working is that more than one person can create the clan test or any clan name. other parts of the skript isnt working because it isnt finished just an fyi

Code:
command /clan [<text>] [<text>] [<player>]:
    trigger:
        if arg 1 is not set:
            if arg 2 is not set:
                message ""
                message "&f&l&m-------------------"
                message "        &8»  &eClans  &8«"
                message ""
                message "  &b/clan create <name>"
                message "  &b/clan invite <clan> <player>"
                message "  &b/clan info <clan>"
                message "  &b/clan list"
                message "  &b/clan join <clan>"
                message "  &b/clan leave <clan>"
                message "  &b/clan kick <player>"
                message "  &b/clan disband <clan>"
                message "  &b/clan help &3(this page)"
                message "&f&l&m-------------------"
                message ""
        if arg 1 is "help":
            message ""
            message "&f&l&m-------------------"
            message "        &8»  &eClans  &8«"
            message ""
            message "  &b/clan create <name>"
            message "  &b/clan invite <clan> <player>"
            message "  &b/clan info <clan>"
            message "  &b/clan list"
            message "  &b/clan join <clan>"
            message "  &b/clan leave <clan>"
            message "  &b/clan kick <player>"
            message "  &b/clan disband <clan>"
            message "  &b/clan help &3(this page)"
            message "&f&l&m-------------------"
            message ""
        if arg 1 is "create":
            if player has permission "can.clan":
                if arg 2 is set:
                    if {clan.in.%uuid of player%} is true:
                        message "&e[!] &7You are already in a clan! Type &c/clan leave&7!"
                    else:
                        set {_clanmake} to arg-2 in lowercase
                        loop {clans::*}:
                            if "%{_clanmake}%" contains "%{loop-value}%":
                                message "&e[!] &7A clan with this name already exists!"
                                stop
                        if length of {_clanmake} is less than or equal to 10:
                            if length of {_clanmake} is greater than 3:
                                if {_clanmake} does not contain " ":
                                    message "&e[!] &7You have created a clan called &6%{_clanmake}%&7!"
                                    set {clan.in.%player's uuid%} to true
                                    add "%{_clanmake}%" to {clans::*}
                                    set {clan.leader.%player's uuid%} to true
                                    set {player.clan.%player's uuid%} to "&8[&7%{_clanmake}%&8] "
                                    add player to {%{_clanmake}%::*}
                                    broadcast "&7&lVSVS &8» &bThe &6%{_clanmake}% &bclan has been created by &e%player%&b!"
                                else:
                                    message "&e[!] &7A clan name cannot contain spaces!"
                            else:
                                message "&e[!] &7A clan name must be longer than 3 characters!"
                        else:
                            message "&e[!] &7A clan name must be 10 characters or less!"
                else:
                    message "&e[!] &7You need to supply a name to your clan!"
            else:
                message "&e[!] &7You need &bStar+&7 to create a clan! &6/buy"
           
        if arg 1 is "leave":
            if arg 2 is set:
                if {clan.in.%uuid of player%} is true:
                    if {clan.leader.%player's uuid%} is true:
                        message "&e[!] &7You are a clan leader! &7To disband your clan, do &c/clan disband&7."
                        stop
                    else:
                        if "%{%arg-2%::*}%" contains "%player%":
                            clear {player.clan.%player's uuid%}
                            clear {clan.in.%player's uuid%}
                            remove player from {%arg-2%::*}
                            message "&e[!] &7You have left your clan!"
                            loop {%arg-2%::*}:
                                send "&e[!] &b%player%&7 has left the clan!" to loop-value
                        else:
                            send "&e[!] &7You are not in that clan!"
                else:
                    message "&e[!] &7You aren't in a clan to leave!"
            else:
                message "&e[!] &7Supply what clan you want to leave!"
               
        if arg 1 is "invite":
            if {clan.in.%uuid of player%} is true:
                if {clan.leader.%player's uuid%} is true:
                    if arg-2 is set:
                        if arg-3 is set:
                            if {clan.in.%arg-3's uuid%} is true:
                                message "&e[!] &b%arg-3% &7is already in a clan!"
                            else:
                                if {%arg-2%::*} contains "%player%":
                                    add arg-3 to {%arg-2%.invites::*}
                                    send "&e[!] &7You were invited to the clan &b%arg-2%&7! To join, do &6/clan join &b%arg-2%&6!" to arg-3
                                    send "&e[!] &7Invite sent to &b%arg-3%&7!" to player
                                    wait 1 minute
                                    remove arg-3 from {%arg-2%.invites::*}
                                    send "&e[!] &7Your invite from &b%player% &7has expired!" to arg-3
                                    send "&e[!] &7Your invite to &b%arg-3%&7 has expired!" to player
                                else:
                                    message "&e[!] &7You aren't the leader of that clan!"
                else:
                    message "&e[!] &7You must be the clan leader to invite somebody to the clan!"
                           
        if arg 1 is "disband":
            if arg 2 is set:
                if {clan.in.%uuid of player%} is true:
                    if {clan.leader.%player's uuid%} is true:
                        set {_clan} to arg-2 in lowercase
                        if {%{_clan}%::*} contains "%player%":
                            loop {%{_clan}%::*}:
                                clear {player.clan.%loop-value's uuid%}
                                clear {clan.in.%loop-value's uuid%}
                            reset {%{_clan}%::*}
                            remove "%{_clan}%" from {clans::*}
                            broadcast "&7&lVSVS &8» &bThe &6%{_clan}% &bclan has been disbanded by &e%player%&b!"
                        else:
                            message "&e[!] &7You aren't the leader of that clan!"
                else:
                    message "&e[!] &7You aren't in a clan to begin with!"
            else:
                message "&e[!] &7Supply the clan name you wish to disband!"

        if arg 1 is "list":
            message ""
            message "&f&l&m-------------------"
            message "        &8»  &eClan List  &8«"
            loop {clans::*}:
                message "&e##%loop-index%&7: &b%loop-value%"
            message "&f&l&m-------------------"
            message ""
command /tester:
    permission: is.owner
    trigger:
        clear {clans::*}
        loop all players:
            clear {clan.in.%loop-player's uuid%}
            clear {clan.leader.%loop-player's uuid%}
 
Last edited:
Hey EpicLucas100,

The reason this is not working is you are using {loop-value} and not loop-value. Loop-value is not a variable.

Also you do not need to use a loop here. Instead use:
Code:
if "%{clans::*}%" contains {_clanmake}:

On top of all this, please do not include your entire code when it is just a specific section not working as this makes it much harder to provide help.

I hope this helps!
 
it did help! Thanks so much. It fixed the issue with clan create but now it caused a new issue with clan disband. If someone makes a clan called "warrriorcat" and someone else makes a clan called "warriorcar" and the leader for warriorcar disbands it kicks everyone from warriorcat but not actually removing the clan, and it shouldnt kick them in the first place.
Code:
if arg 1 is "disband":
            if arg 2 is set:
                if {clan.in.%uuid of player%} is true:
                    if {clan.leader.%player's uuid%} is true:
                        set {_clan} to arg-2 in lowercase
                        if {%{_clan}%::*} contains "%player%":
                            loop {%{_clan}%::*}:
                                clear {player.clan.%loop-value's uuid%}
                                clear {clan.in.%loop-value's uuid%}
                            reset {%{_clan}%::*}
                            remove "%{_clan}%" from {clans::*}
                            broadcast "&7&lVSVS &8» &bThe &6%{_clan}% &bclan has been disbanded by &e%player%&b!"
                        else:
                            message "&e[!] &7You aren't the leader of that clan!"
                else:
                    message "&e[!] &7You aren't in a clan to begin with!"
            else:
                message "&e[!] &7Supply the clan name you wish to disband!"

thats the code, i hope you can help with this too!
 
Are there 2 different acccounts in the clan or are they both you?

Because if they are both you, they will over ride each other.
 
Status
Not open for further replies.