Solved Global 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.

Desboks

Member
Apr 5, 2017
15
0
0
21
Hello!

I made a chat channel plugins and I struggled with something.
I want to make a feature where if people starts their message with "!", the message will be announced globally. I tried 'if message contains "!", but that doesn't work.

Can someone help me? Thanks!
- DL_1003
 
Works well to me.
code_language.skript:
on chat:
    cancel the event
    if message contains "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
 
Works well to me.
code_language.skript:
on chat:
    cancel the event
    if message contains "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
Yeah, true. But the message has to start with ! If I end the message with ! It works too, but that shouldn't be happening.
 
Here you go
code_language.skript:
on chat:
    cancel the event
    set {_message} to "%first capitalization of message%"
    if {_message} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
 
  • Like
Reactions: Desboks
Here you go
code_language.skript:
on chat:
    cancel the event
    set {_message} to "%first capitalization of message%"
    if {_message} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
Thanks!
[doublepost=1491419041,1491418579][/doublepost]
Here you go
code_language.skript:
on chat:
    cancel the event
    set {_message} to "%first capitalization of message%"
    if {_message} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
Hmm, I checked it double and it says: 'message' is not an item stack
 
Thanks!
[doublepost=1491419041,1491418579][/doublepost]
Hmm, I checked it double and it says: 'message' is not an item stack
code_language.skript:
on chat:
    cancel the event
    set {_message} to "%first capitalization of message%" parsed as text
    if {_message} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
 
code_language.skript:
on chat:
    cancel the event
    set {_message} to "%first capitalization of message%" parsed as text
    if {_message} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
Hmm, weird. It still says 'message is not an item stack'
 
code_language.skript:
on chat:
    cancel the event
    set {_message} to "%message%" parsed as text
    set {_check} to "%first capitalization of {_message}%" parsed as text
    if {_check} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
 
code_language.skript:
on chat:
    cancel the event
    set {_message} to "%message%" parsed as text
    set {_check} to "%first capitalization of {_message}%" parsed as text
    if {_check} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
I searched the code and I saw that I needed the 'SkriptPlus' add-on, so I searched it on internet but couldn't find a working link. Do you have a working SkriptPlus for me?
 
I searched the code and I saw that I needed the 'SkriptPlus' add-on, so I searched it on internet but couldn't find a working link. Do you have a working SkriptPlus for me?

My bad. (With that you don't need any addons.)
code_language.skript:
on chat:
    cancel the event
    set {_check} to the first characters of message
    if {_check} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
 
My bad. (With that you don't need any addons.)
code_language.skript:
on chat:
    cancel the event
    set {_check} to the first characters of message
    if {_check} is "!":
        replace all "!" with "" in message
        broadcast "GLOBAL: %message%"
    else:
        broadcast "NORMAL: %message%"
You are a saver! Thanks!
 
Status
Not open for further replies.