Solved Problem with Skript chat

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

Ouma Shu

Member
Dec 25, 2017
45
2
0
33
London
What's wrong with this? It doesn't send the message.
Code:
on chat:
    cancel event
    if "%region at player%" is "<none>":
        loop all players:
            if "%region at loop-player%" is "%region at player%":
                if {colors} is not set:
                    set {colors} to 1
                if {colors} is 1:
                    if {nickname.%player%} is not set:
                        send "%player% > &f%coloured message%" to loop-player
                        set {colors} to 2
                        stop
                    else if {nickname.%player%} is set:
                        send "%{nickname.%player%}% > &f%coloured message%" to loop-player
                        set {colors} to 2
                        stop
                else if {colors} is 2:
                    if {nickname.%player%} is not set:
                        send "%player% > &7%coloured message%" to loop-player
                        set {colors} to 1
                        stop
                    else if {nickname.%player%} is set:
                        send "%{nickname.%player%}% > &7%coloured message%" to loop-player
                        set {colors} to 1
                        stop
It works just if I do ;broadcast; instead of ;send "%{nickname.%player%}% > &7%coloured message%" to loop-player;
 
Last edited:
What's wrong with this? It doesn't send the message.
Code:
on chat:
    cancel event
    if "%region at player%" is "<none>":
        loop all players:
            if "%region at loop-player%" is "%region at player%":
                if {colors} is not set:
                    set {colors} to 1
                if {colors} is 1:
                    if {nickname.%player%} is not set:
                        send "%player% > &f%coloured message%" to loop-player
                        set {colors} to 2
                        stop
                    else if {nickname.%player%} is set:
                        send "%{nickname.%player%}% > &f%coloured message%" to loop-player
                        set {colors} to 2
                        stop
                else if {colors} is 2:
                    if {nickname.%player%} is not set:
                        send "%player% > &7%coloured message%" to loop-player
                        set {colors} to 1
                        stop
                    else if {nickname.%player%} is set:
                        send "%{nickname.%player%}% > &7%coloured message%" to loop-player
                        set {colors} to 1
                        stop
It works just if I do ;broadcast; instead of ;send "%{nickname.%player%}% > &7%coloured message%" to loop-player;
try set:
code_language.skript:
if "%region at player%" is "__global__":
 
If you do not send the message to all players within the loop, it is because skript detects "<none>" as a region.
[doublepost=1553891218,1553891026][/doublepost]or if problem is with variable "{colors}", try set:
code_language.skript:
on skript load:
    set {colors} 1
me think
 
So, why if I put "broadcast" it works and if I put "send to loop-player" it doesn't work?
Then, put
Code:
if "%region at player%" contains "<none>": #Or __global__ if "<none>" not works
[doublepost=1553906059,1553905999][/doublepost]try changing all
code_language.skript:
if "%region at player%" is "region":
To:
code_language.skript:
if "%region at player%" contains "region":
 
I would also try to use local variable in that region situation, I don't really know if that affects it tho since it works with broadcast and not with send.
Maybe use filters? "send "" to all players where [player input = loop-player]"
 
Thank you all guys for the help, I found how to "fix" it. I separated color formatting from sending the message in two "on chat" events. Thank you all for the help.
 
Status
Not open for further replies.