on private message?

  • 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 community!

    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.

Fantomrat

Member
Dec 3, 2022
1
0
1
How can I do this for a private message (/m, /tell, etc.)?

Code:
on chat:
    if message contains ":loc:":
        set {x.cord} to player's x-coordinate
        set {y.cord} to player's y-coordinate
        set {z.cord} to player's z-coordinate

        set {x.cord} to round({x.cord})
        set {y.cord} to round({y.cord})
        set {z.cord} to round({z.cord})

        replace all ":loc:" with "§a[%{x.cord}%, %{y.cord}%, %{z.cord}%]§f" in message
 
You would have to make a custom private messaging system for instance:
Code:
command /pri <target: player> <message: text>:
    trigger:
        if arg 2 contains ":loc:":
            set {_message} to "%arg 2%"
            set {x.cord} to player's x-coordinate
            set {y.cord} to player's y-coordinate
            set {z.cord} to player's z-coordinate
            set {x.cord} to round({x.cord})
            set {y.cord} to round({y.cord})
            set {z.cord} to round({z.cord})
            replace all ":loc:" with "&a[%{x.cord}%, %{y.cord}%, %{z.cord}%]&r" in {_message}
            send "&8%player%: &7&o%{_message}%" to arg 1
        else:
            send "&8%player%: &7&o%arg 2%" to arg 1
 
Status
Not open for further replies.