Hello, I want to get the first letter of the message.
My code now looks like this:
And it's not working when I start the message with !
I added a line so I can test when the message is not starts with !, and it always activates. Well, if you don't understand:
And it always sends me that test.
[doublepost=1538229006,1538228721][/doublepost]Oh wait! When the ! is the end of the message, it's working.
So when I say !asd it's not working, but it's working with asd!
weird
[doublepost=1538229093][/doublepost]Oh... Using "ends with" it's.. working..
So this code is working now:
But.. Why is the "starts with" not working?
My code now looks like this:
code_language.skript:
on chat:
if message starts with "!":
if player has permission "yellowchat":
set {msg} to message
replace all "!" with "" in {msg}
cancel event
loop all players:
send "&f<%player%> &e%{msg}%" to loop-player
And it's not working when I start the message with !
I added a line so I can test when the message is not starts with !, and it always activates. Well, if you don't understand:
code_language.skript:
on chat:
if message starts with "!":
if player has permission "yellowchat":
set {msg} to message
replace all "!" with "" in {msg}
cancel event
loop all players:
send "&f<%player%> &e%{msg}%" to loop-player
else:
send "test"
[doublepost=1538229006,1538228721][/doublepost]Oh wait! When the ! is the end of the message, it's working.
So when I say !asd it's not working, but it's working with asd!
weird
[doublepost=1538229093][/doublepost]Oh... Using "ends with" it's.. working..
So this code is working now:
code_language.skript:
on chat:
if message ends with "!":
if player has permission "yellowchat":
set {msg} to message
replace all "!" with "" in {msg}
cancel event
loop all players:
send "&f<%player%> &e%{msg}%" to loop-player
else:
send "test"
But.. Why is the "starts with" not working?