Is it possible to merge two strings

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

ImMeh

Member
Jul 14, 2019
11
0
1
21
Hello, I'm in the middle of making a chat color skript. I was wondering if it's possible to merge two strings like
code_language.skript:
set {chatcolor.%arg 1%} to "&"+"%arg 2%"

Full code
code_language.skript:
command /chatcolor [<player>] [<text>]:
   trigger:
       if {rank.%player%} is "owner":
           if arg 1 is not set:
               send "{@p} &8» &7/chatcolor [player] [color]"
               stop
           if arg 2 is not set:
               send "{@p} &8» &7/chatcolor [player] [color]"
               stop
           if arg 1 is set:
               if arg 2 is set:
                   set {chatcolor.%arg 1%} to "&"+"%arg 2%"
       else:
           send "{@p} &8» &7You are not allowed to do that"
 
try
code_language.skript:
set {chatcolor.%arg 1%} to "&%arg 2%"

Thanks for the reply but it didn't quite work.
I use this for my chat
code_language.skript:
if {rank.%player%} is "default":
       broadcast "&8Default &7%{name.%player%}% &8» %{chatcolor.%player%}%%message%"
It says
Default ImMeh » &3Test
 
Thanks for the reply but it didn't quite work.
I use this for my chat
code_language.skript:
if {rank.%player%} is "default":
       broadcast "&8Default &7%{name.%player%}% &8» %{chatcolor.%player%}%%message%"
It says
Default ImMeh » &3Test
Use the colored expression on the full string
 
Use the colored expression on the full string

Like this
code_language.skript:
set {_message} to "%{chatcolor.%player%}%%message%"
if {rank.%player%} is "default":
   broadcast "&8Default &7%{name.%player%}% &8» %{_message}%"

It doesn't work
 
Last edited:
Like this
code_language.skript:
set {_message} to "%{chatcolor.%player%}%%message%"
if {rank.%player%} is "default":
   broadcast "&8Default &7%{name.%player%}% &8» %{_message}%"

It doesn't work
When you have a string where there is still a color code not formatted, so you can see the &3 for example, you need to use the colored expression (might be broken on 2.3.7/2.4-alpha4, build yourself if you want to fix that).
 
Status
Not open for further replies.