Clans(teams) skript

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

    Now, what are you waiting for? Join the community now!

Nov 22, 2021
1
0
1
I have only three days left to create a skript for clans. I know basic skript but nothing so advanced. I tried vibe coding it(ikik but Im running out of options), chatgpt doesn't want to cooperate in any way with modern skript documentation and it without it it's worse than me. I just need a few simple commands, idk if it's the right thing to ask here, but if anyone can help me with even just a single command I'd be SO GRATEFUL. Feel free to suggest any changes in the skripts, the /createclan or even the ideas. If it's easier don't focus on stuff like messages, I will change them myself.



/createclan:

permission: clan.admin

creates a clan with luckperms, adds the leader, sets the color and logs it


code_language.skript:
options:

    maincolor: "B00B0B"

    textcolor: "ffebb6"

    infocolor: "279FF5" #for example when adding a player this is the color of their ign

    confirmcolor: "27F554"

    prefix_text: "Clans"

    invite_duration: 5 minutes

    max_members: 10



command /createclan <text> <text> <player>:

    permission: clan.admin

    trigger:

        set {_raw} to arg-1

        set {_hex} to arg-2

        set {_leader} to arg-3



        if {_leader} is not online:

            send colored "<##%{@maincolor}%>[%{@prefix_text}%] <##ff0000>Leader must be online." to player

            stop



        if {_raw} does not match "[A-Za-z0-9]*":

            send colored "<##%{@maincolor}%>[%{@prefix_text}%] <##ff0000>Clan name may only contain letters and numbers." to player

            stop



        set {_name} to {_raw}

        set {_lower} to lowercase {_name}



        loop {clanlist::*}:

            if lowercase loop-value is {_lower}:

                send colored "<##%{@maincolor}%>[%{@prefix_text}%] <##ff0000>Clan name already exists." to player

                stop



        if length of {_hex} is not 6:

            send colored "<##%{@maincolor}%>[%{@prefix_text}%] <##ff0000>Hex color must be exactly 6 characters." to player

            stop

        if {_hex} does not match "[A-Fa-f0-9]*":

            send colored "<##%{@maincolor}%> [%{@prefix_text}%] <##ff0000>Invalid hex color." to player

            stop



        add {_name} to {clanlist::*}

        set {clan::%{_name}%::color} to {_hex}

        set {clan::%{_name}%::leader} to name of {_leader}

        # store members by player name

        set {clan::%{_name}%::members::%name of {_leader}%} to true

        set {clan::%{_name}%::size} to 1



        make console execute "lp creategroup %{_name}%"

        make console execute "lp group %{_name}% meta setprefix &#%{_hex}%"

        make console execute "lp group %{_name}% setweight 2"

        make console execute "lp group %{_name}% parent add default"

        make console execute "lp user %{_leader}% parent add %{_name}%"



        log "Clan %{_name}% created by %{player}%" to "clans"

        send colored "<##%{@maincolor}%> [%{@prefix_text}%] <##%{@textcolor}%>Clan <##%{_hex}%>%{_name}% <##%{@textcolor}%>successfully created." to player



/addmember <player> - runnable by the leader

sends an invite acceptable with /acceptclaninvite or clicking the invite message, on accept it sends a message to the whole clan "[Clans] <player> has joined the clan.", you can only invite players which arent in a clan already



/appointrole <player> <role> - runnable by the leader

roles will be in a list I am yet to finish, rn we can call them role1 - role10

when run it gives the <player> the group.role.<role> permission and marks that the clan has the role already - nobody else can get it - receiving the role is accepted with /acceptrole or clicking



/setclanhome - runnable by the leader

sets the clan home, to which the players can tp with /home - the standard 5 second no move countdown



/tpa and /tphere - both runnable by the leader

the standard thing, with /tpaccept and /tpdeny and the 5 second no move countdown

only the leader can use them and he can only use it with his own clanmates



/cc <message> or /clanchat <message>

sends the message to the whole clan - runnable by everyone



THANK YOU ❤️
 
Last edited: