Message two texts in one line

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

Deleted member

Skript Version (do not put latest): Skript dev35b
Skript Author: Bensku
Minecraft Version: 1.12.2
---

Full Code:
code_language.skript:
options:
    prefix: "&6[&4Broadcast&6]&a "

command /broadcast <text>:
    aliases: /bc
    permission: "test.broadcast"
    trigger:
        message "{@prefix}%arg 1%" to all players

Errors on Reload:

Can't understand this condition/effect: message ""&6[&4Broadcast&6]&a "%arg 1%" to all players (Test.sk, line 8: message "{@prefix}%arg 1%" to all players')

Console Errors: none

Addons using (including versions):
Skellett 1.9.6b

Troubleshooting: Yes

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes

What other methods have you tried to fix it?
I've tryed changing the wrong line to:
code_language.skript:
message "{@prefix}%arg 1%" to all players
message {@prefix} arg 1 to all players
message "%{@prefix}%%arg 1%" to all players
message "{@prefix}" %arg 1% to all players
message {@prefix} "%arg 1%" to all players
message "{@prefix}"%arg 1% to all players
message {@prefix}"%arg 1%" to all players
Non of which work. The only version it worked was the following:
code_language.skript:
message {@prefix} and arg 1 to all players
but this wrote them in two separate lines, and I want it to write it to one line.
 
You have to use
code_language.skript:
options:
    prefix: &6[&4Broadcast&6] &a
because Skript will sort of replace all of the options with their corresponding value when loading. That means that Skript will see the line as this:
code_language.skript:
message ""&6[&4Broadcast&6]&a "%arg 1%" to all players
and that has has invalid quotation marks
 
code_language.skript:
options:
   prefix: "&6[&4Broadcast&6]&a " Remove the quotation marks and 
command /broadcast <text>:
  trigger:
      broadcast "{@prefix} %arg-1%"
 
code_language.skript:
prefix: "&6[&4Broadcast&6]&a " Remove
Message all players will send it to all players, broadcast will also include console. It's just what you prefer.
 
broadcast is a Skript effect (broadcast %string%)
 
Status
Not open for further replies.