Solved Multi-language problem [GER/EN]

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

Allesco

New Member
Feb 2, 2018
6
0
0
21
Germany, Lower Saxony
Hello there,

I want to create a system on my server, which supports german AND english.
But I have problems with it.
So here is a problem with a chatclear command.
I want that the players who got the language "english" get the english message
and "german" the german message.

Here is my Skript:

code_language.skript:
command /cc:
    aliases: /clearchat,/chatclear
    permission: command.cc
    permission message:  &8» &cDazu hast du keine Rechte!
    trigger:
        loop 200 times:
            broadcast ""
        loop all players:
            network variable {language.%loop-player%} is "german":
                broadcast "&8«&7&m----------&8» &2MatrixMC&7.&aDE &8«&7&m----------&8»"
                broadcast ""
                broadcast "&7Der Chat wurde von &e%player%&r &7geleert!"
                broadcast ""
                broadcast "&8«&7&m----------&8» &2MatrixMC&7.&aDE &8«&7&m----------&8»"
            network variable {language.%loop-player%} is "english":
                broadcast "&8«&7&m----------&8» &2MatrixMC&7.&aDE &8«&7&m----------&8»"
                broadcast ""
                broadcast "&7The chat has been cleared by &e%player%&7!"
                broadcast ""
                broadcast "&8«&7&m----------&8» &2MatrixMC&7.&aDE &8«&7&m----------&8»"

Now all players get both messages. Thank you for your help!
regards, Allesco | Timon
 
you are broadcasting it, so it's being sent to all players by default. You can use send or message to send it to a specific player.
 
Ah thank you! :emoji_wink:

I just editing this. pls wait
[doublepost=1517564451,1517564325][/doublepost]So yes, the following code works!


code_language.skript:
command /cc:
    aliases: /clearchat,/chatclear
    permission: command.cc
    permission message:  &8» &cDazu hast du keine Rechte!
    trigger:
        loop 200 times:
            broadcast ""
        loop all players:
            network variable {language.%loop-player%} is "german":
                message "&8«&7&m----------&8» &2MatrixMC&7.&aDE &8«&7&m----------&8»" to loop-player
                message "" to loop-player
                message "&7Der Chat wurde von &e%player% &7geleert!" to loop-player
                message "" to loop-player
                message "&8«&7&m----------&8» &2MatrixMC&7.&aDE &8«&7&m----------&8»" to loop-player
            network variable {language.%loop-player%} is "english":
                message "&8«&7&m----------&8» &2MatrixMC&7.&aDE &8«&7&m----------&8»" to loop-player
                message "" to loop-player
                message "&7The chat has been cleared by &e%player%&7!" to loop-player
                message "" to loop-player
                message "&8«&7&m----------&8» &2MatrixMC&7.&aDE &8«&7&m----------&8»" to loop-player
 
Status
Not open for further replies.