Solved Play sound for /msg /m /tell /essentials:msg

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

EvilSlayer

Member
Dec 23, 2020
21
1
3
21
First, sorry for my bad english.
When the player sends a private message to the other people, play sound active.
How can I do this.
My Mention Skript:​
Code:
options:
        title: &b
        subtitle: &7✉ &6%Player% &7Senden Bahsetti! ✉
on chat:
    loop all players:
        if message contains "%loop-player%":
            replace all "%loop-player%" with "&e@%loop-player% &7" in message
            play sound "block_beehive_exit" with volume 1 and pitch 1.0 at loop-player for loop-player
            send title "{@title}" with subtitle "{@subtitle}" to loop-player for 5 seconds
"
 
I'm confused. You want a mention script or you want every time someone sends a private message a sound to play?
 
Last edited:
Hey EvilSlayer,

Your best bet at reliably doing this is to create your own message skript! Below I will include an example:

Code:
command /msg <player> <text>:
    aliases: /message, /tell, /m
    usage: /msg <player> <message>
    trigger:
        send "&6[Me -> %arg 1%] &7%arg 2%"
        send "&6[%player% -> me] &7%arg 2%" to arg 1
        set {lastMessage::%arg 1%} to player
        set {lastMessage::%player%} to arg 1

on quit:
    delete {lastMessage::%player%}

command /r <text>:
    aliases: /reply
    usage: /r <message>
    trigger:
        if {lastMessage::%player%} is not set:
            send "&cYou have no one to reply to!"
            stop
        if {lastMessage::%player%} is not online:
            send "&cYou have no one to reply to!"
            stop
        
        send "&6[Me -> %{lastMessage::%player%}%] &7%arg 1%"
        send "&6[%player% -> me] &7%arg 1%" to {lastMessage::%player%}[/COLOR]

You can now add your sounds!

Reasons why not to use essentials:
- It will be impossible to fully tell when someone messages someone, your best bet would be to read every command someone does but what if someone has ignored the player etc., it is impossible to tell these factors with skript
- Seeing as you want to customize your message system this could help!

You may now add your sound code where you want it!

I hope this helps!
 
Hey EvilSlayer,

Your best bet at reliably doing this is to create your own message skript! Below I will include an example:

Code:
command /msg <player> <text>:
    aliases: /message, /tell, /m
    usage: /msg <player> <message>
    trigger:
        send "&6[Me -> %arg 1%] &7%arg 2%"
        send "&6[%player% -> me] &7%arg 2%" to arg 1
        set {lastMessage::%arg 1%} to player
        set {lastMessage::%player%} to arg 1

on quit:
    delete {lastMessage::%player%}

command /r <text>:
    aliases: /reply
    usage: /r <message>
    trigger:
        if {lastMessage::%player%} is not set:
            send "&cYou have no one to reply to!"
            stop
        if {lastMessage::%player%} is not online:
            send "&cYou have no one to reply to!"
            stop
       
        send "&6[Me -> %{lastMessage::%player%}%] &7%arg 1%"
        send "&6[%player% -> me] &7%arg 1%" to {lastMessage::%player%}[/COLOR]

You can now add your sounds!

Reasons why not to use essentials:
- It will be impossible to fully tell when someone messages someone, your best bet would be to read every command someone does but what if someone has ignored the player etc., it is impossible to tell these factors with skript
- Seeing as you want to customize your message system this could help!

You may now add your sound code where you want it!

I hope this helps!
How can I add sound can you send me added sound version? and one error this skript
unknown.png
 
Status
Not open for further replies.