#skript clans
1 messages · Page 1 of 1 (latest)
yes
send ur code
i'm going to send skript
ok
how do u format it
!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
```
'''
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
oh
its on the ~ key
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%}
also doesnt arg 2 have to be arg-2?
ye but
?
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
there isn't one
it wont broadcast it?
there isn't an error
or tell it
i just simply can't
it wont send the list?
cause you do need % around the start and end of a list variable.
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
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
yes but
ther's anotuer problem
i want there to be multiple lists of memebrs bc there are gonna be multiple clans
ok.
so it wont know what this is referrring to
its always a good idea to seperate with :: and never .
But how do i do this
Anyone ?^^
you create lists with ::
Ye ik
^^^^^^
Ah ik
I want it
To create a new list everytime a new clan is created
what is %clanname%
thats what this does...
read the basics please
that was there for you to replace
But arg 2 changes when u run a different cmd
Like...
?
also why are your args mandatory?
if you cant keep up with this
why do you sound upset? you're learning useful skills that will help you in all your skript endeavors..
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
Alr
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
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}
send "This is a messag%nl%on two lines!" to player
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
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"```
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
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>
.
{list::*}
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^^^
dont start the name with arg-2
but i want it to start with the clan name which is provided by the player (arg-2)
so like for example
{test::Members::*}
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::*}
exactly
executor being person who executed command
yes
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
wdym
change the %arg-2% to %arg-1%
oh