#skript clans

1 messages · Page 1 of 1 (latest)

exotic compass
#

so i need help with referencing specific variables in my skript (i'm not sure how else to explain it)

mystic gull
#

did u

#

even try?

exotic compass
#

yes

mystic gull
#

send ur code

exotic compass
#

i'm going to send skript

mystic gull
#

ok

exotic compass
#

how do u format it

mystic gull
#

!format

glass spadeBOT
# mystic gull !format

:technologist: Code Blocks

To make it easier for others to read your code, it is asked that you send it in a code block. On Discord, you can simply send this:

```
Code here
```

exotic compass
#

'''
command /clans [<string>] [<string>]:
trigger:
if arg 1 is "help":
send " &7&l[&a&lZ&6&l&oKitz&7&l]" to player
send " &6&lList of commands:" to player
send " &7/clans &7&lcreate" to player
send " &7/clans &7&llist [members] [clan name]" to player
send " &7/clans &7&ljoin [clan name]" to player
send " &7/clans &7&lleave [clan name]" to player

    else if arg 1 is "create":
        if {CLANS::*} doesn't contain arg-2:
            add arg-2 to {CLANS::*}
            send "&6%{CLANS::*}%" to player
            set {_%arg 2%Creator} to {name.%player%}            
            send "&7&l[&a&lZ&6&l&oKitz&7&l] &b&l%player% Created a Clan!" to all players
        else:
            send "&cThat clan already exists!" to player
    else if arg 1 is "list":
        if arg 2 is not set:
            send "           &7&l[&a&lZ&6&l&oKitz&7&l]" to player
            send "   &6&lList of clans:" to player
            send "   &b&l%{CLANS::*}%" to player
        else if arg 2 is "members":
            if arg 2 is in {CLANS::*}:
                send "&bThe players in %arg-2% are" to player
                send "" to player #<--this is where the problem is <-- i want it to send a list of all the players in that clan (that list is made in line 32)
            else:
                send "&cPlease send a valid clan name!" to player
    else if arg 1 is "join":
        if arg 2 is in {CLANS::*}
            add {name.%player%} to {Members.%arg-2%}

'''

#

it didn't work

mystic gull
#

not those

#

`

#

use those

exotic compass
#

oh

mystic gull
#

its on the ~ key

exotic compass
#
command /clans [<string>] [<string>]:
    trigger:
        if arg 1 is "help":
            send "           &7&l[&a&lZ&6&l&oKitz&7&l]" to player
            send "   &6&lList of commands:" to player
            send "     &7/clans &7&lcreate" to player
            send "     &7/clans &7&llist [members] [clan name]" to player
            send "     &7/clans &7&ljoin [clan name]" to player
            send "     &7/clans &7&lleave [clan name]" to player

        else if arg 1 is "create":
            if {CLANS::*} doesn't contain arg-2:
                add arg-2 to {CLANS::*}
                send "&6%{CLANS::*}%" to player
                set {_%arg 2%Creator} to {name.%player%}            
                send "&7&l[&a&lZ&6&l&oKitz&7&l] &b&l%player% Created a Clan!" to all players
            else:
                send "&cThat clan already exists!" to player
        else if arg 1 is "list":
            if arg 2 is not set:
                send "           &7&l[&a&lZ&6&l&oKitz&7&l]" to player
                send "   &6&lList of clans:" to player
                send "   &b&l%{CLANS::*}%" to player
            else if arg 2 is "members":
                if arg 2 is in {CLANS::*}:
                    send "&bThe players in %arg-2% are" to player
                    send "" to player #<--this is where the problem is <-- i want it to send a list of all the players in that clan (that list is made in line 32)
                else:
                    send "&cPlease send a valid clan name!" to player
        else if arg 1 is "join":
            if arg 2 is in {CLANS::*}
                add {name.%player%} to {Members.%arg-2%}
mystic gull
#

also doesnt arg 2 have to be arg-2?

exotic compass
#

no

#

it can be

#

either

mystic gull
#

ok

#

to send a variable, cant you just do broadcast "%{yeet::*}%"?

exotic compass
#

ye but

mystic gull
#

?

exotic compass
#

i want to send

#

wait

#

lemme think

#

send "{Members.%arg-2%}" to player

#

and u need % around the variable

#

but then it won't work

#

and it will also thing %arg-2% means the second argument of the command that the player just ran

#

not the one i want

mystic gull
#

can u send da error?

#

message

exotic compass
#

there isn't one

mystic gull
#

it wont broadcast it?

exotic compass
#

there isn't an error

mystic gull
#

or tell it

exotic compass
#

i just simply can't

mystic gull
#

it wont send the list?

#

cause you do need % around the start and end of a list variable.

exotic compass
#

ye and the variable's name has % in it

#

so it would look like %{Members.%arg-2%}%

mystic gull
#

%Members::%arg-2%}%

#

like this?

exotic compass
#

ye but

#
%{Members.%arg-2%}%
mystic gull
#

what about that?

#

thats how u broadcast

#

you can have percents in there too.

exotic compass
#

wait

#

u sent it as a list

#

should it be a list not a variable

#

so u sent ::

#

Members::%arg-2%

#

i sent Members.%arg-2%

#

which one should it be

mystic gull
#

oh yeah

#

do you want members to be a list?

exotic compass
#

oh shoot

#

ye

#

it has to be

#

bc its gonna have loads of memebrs

#

alr i'll try that and then come back when it doesn't work

#

i mean if

mystic gull
#

then

#

it would be

#

%{Members::*}%

exotic compass
#

yes but

#

ther's anotuer problem

#

i want there to be multiple lists of memebrs bc there are gonna be multiple clans

mystic gull
#

ok.

exotic compass
mystic gull
#

then

#

how many clans are there?

exotic compass
#

there will be as many as there are

#

like

#

players can make their own

zenith mirage
#

its always a good idea to seperate with :: and never .

exotic compass
#

Alr

#

Thanks

exotic compass
#

Anyone ?^^

zenith mirage
#

you create lists with ::

exotic compass
#

Ye ik

zenith mirage
exotic compass
#

Ah ik

#

I want it

#

To create a new list everytime a new clan is created

zenith mirage
#

mhmm

#

just add player to {clanName::*}

exotic compass
#

Ye but {%clanname%::*}

#

Ye i have that

zenith mirage
#

what is %clanname%

exotic compass
#

But i want it to create an individual list for each clans

#

Oh

zenith mirage
zenith mirage
exotic compass
#

Wait

#

But

#

ClanName

#

Then there would only be one list called clanname

zenith mirage
#

nooo

#

thats where you put the clans name

exotic compass
#

I want clan name to be arg 2

#

Which is %arg-2%

zenith mirage
#

that was there for you to replace

exotic compass
#

But arg 2 changes when u run a different cmd

zenith mirage
#

then you use a different expression

#

or make a function

exotic compass
#

Like...
?

zenith mirage
#

also why are your args mandatory?

exotic compass
#

Wdym

#

Oh

zenith mirage
exotic compass
#

😐

#

Alr

#

Fine

zenith mirage
#

why do you sound upset? you're learning useful skills that will help you in all your skript endeavors..

exotic compass
#

Im reading it rn

#

Its the most useful thing ever

#

Like fr

#

Its amazing

#

Thanks

#

Wait one thing quickly

#

Sry

#

See bottom left

#

I want to send that to the player

#

How

zenith mirage
#

can you send it

#

a bunch is cut off

exotic compass
#

Alr

zenith mirage
#

also you can use %nl% (= %newline%) inside a string to go down to the next line
that way you dont have to send multiple messages

exotic compass
#

Oh thanks

#
command /clans [<string>] [<string>]:
    trigger:
        if arg 1 is "help":
            send "           &7&l[&a&lZ&6&l&oKitz&7&l]" to player
            send "   &6&lList of commands:" to player
            send "     &7/clans &7&lcreate" to player
            send "     &7/clans &7&llist [members] [clan name]" to player
            send "     &7/clans &7&ljoin [clan name]" to player
            send "     &7/clans &7&lleave [clan name]" to player

        else if arg 1 is "create":
            if {CLANS::*} doesn't contain arg-2:
                add arg-2 to {CLANS::*}
                send "&6%{CLANS::*}%" to player
                set {%arg 2%Creator} to {name.%player%}            
                send "&7&l[&a&lZ&6&l&oKitz&7&l] &b&l%player% Created a Clan!" to all players
            else:
                send "&cThat clan already exists!" to player
        else if arg 1 is "list":
            if arg 2 is not set:
                send "           &7&l[&a&lZ&6&l&oKitz&7&l]" to player
                send "   &6&lList of clans:" to player
                send "   &b&l%{CLANS::*}%" to player
            else if arg 2 is "members":
                if {CLANS::*} contains arg-2:
                    send "&bThe players in %arg-2% are" to player
                    send "%{%arg-2%::Members}%" to player
                else:
                    send "&cPlease send a valid clan name!" to player
        else if arg 1 is "join":
            if {CLANS::*} doesn't contain arg-2:
                add {name.%player%} to {%arg-2%::Members}
zenith mirage
#

send "This is a messag%nl%on two lines!" to player

exotic compass
#

ik i'll do that later but

#

how do i fix this

zenith mirage
#

set {%arg 2%Creator} to {name.%player%}
why are you not seperating with ::?

#

also dont start the variable with arg-2

#

make it {clans::owner::%arg-2%} or something

exotic compass
#

see where it says

send "%{%arg-2%::Members}%" to player
#

how do i fix that line

zenith mirage
#

thats a single object not a list

#
set {example::2} to "ggyfuyf"

send "%{example::1}%" to player # sends "ahwirgaw"
send "%{example::2}%" to player # sends "ggyfuyf"
send "%{example::*}%" to player # sends "ahwirgaw and ggyfuyf"```
exotic compass
#

alr i get that now

#

how do i implement that

#

would i have to set {arg-2} to %arg-2%?
and then do

#

ah idk man

#

this is hard

#

theres nothing in the docs

#

abt this

zenith mirage
#

no

#

use *

#

for all indices

exotic compass
#

where do i use that

#

ive got to the point where i can join the clan but when i go to list, it outputs <none>

exotic compass
#

i dont know what u mean i understand that * means list all the things in that list and x::1 lists just 1 in the list x

#

but like where do i use that

#
        else if arg 1 is "list":
            if arg 2 is not set:
                send "           &7&l[&a&lZ&6&l&oKitz&7&l]" to player
                send "   &6&lList of clans:" to player
                send "   &b&l%{CLANS::*}%" to player
            else if arg 2 is "members":
                if {CLANS::*} contains arg-3:
                    send "&bThe players in %arg-3% are" to player
                    send "%{arg-2::Members}%" to player
                else:
                    send "&cPlease send a valid clan name!" to player
        else if arg 1 is "join":
            if {CLANS::*} contains arg-2:
                send "debug" to player
                add {name::%player%} to {%arg-2%::Members}
                send "debug3" to player

^^^all relevant code^^^

zenith mirage
#

dont start the name with arg-2

exotic compass
#

but i want it to start with the clan name which is provided by the player (arg-2)

#

so like for example

#
{test::Members::*}
zenith mirage
#

you should do something like thisif arg-1 = "create": set {clans::%arg-2%::owner} to executor else if arg-1 = "join": if {clans::%arg-2%::owner} is not set: send "that clan does not exist!" to executor stop add executor's uuid to {clans::%arg-2%::members::*}

zenith mirage
exotic compass
#

executor being person who executed command

zenith mirage
#

yes

exotic compass
#

alr

#

i'll try

exotic compass
#

alr everything is working... apart from this

#

but take it out of context:

{clans::%arg-2%::members::*}

how would i get another command to send that to the player

#

lemme make an example skript

#
command: /createclan [<string>]:
    trigger:
        add executor's uuid to {clans::%arg-2%::members::*}

command: /listmembers [<string>]
    trigger:
        send "" to player #Here i would like to send '{clans::%arg-2%::members::*}' to the player
zenith mirage
#

exactly that

#

but arg1

exotic compass
#

wdym

mystic gull
exotic compass
#

Ye thats a test

#

In my actual skript there are more ags

#

Args

#

But yes

mystic gull
#

oh