1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

on private message?

Discussion in 'Skript' started by Fantomrat, Dec 3, 2022.

  1. Fantomrat

    Fantomrat Member

    Joined:
    Dec 3, 2022
    Messages:
    1
    Likes Received:
    0
    How can I do this for a private message (/m, /tell, etc.)?

    Code (Text):
    1. on chat:
    2.     if message contains ":loc:":
    3.         set {x.cord} to player's x-coordinate
    4.         set {y.cord} to player's y-coordinate
    5.         set {z.cord} to player's z-coordinate
    6.  
    7.         set {x.cord} to round({x.cord})
    8.         set {y.cord} to round({y.cord})
    9.         set {z.cord} to round({z.cord})
    10.  
    11.         replace all ":loc:" with "§a[%{x.cord}%, %{y.cord}%, %{z.cord}%]§f" in message
     
  2. Witho

    Witho New Member

    Joined:
    Dec 6, 2022
    Messages:
    7
    Likes Received:
    0
    You would have to make a custom private messaging system for instance:
    Code (Text):
    1. command /pri <target: player> <message: text>:
    2.     trigger:
    3.         if arg 2 contains ":loc:":
    4.             set {_message} to "%arg 2%"
    5.             set {x.cord} to player's x-coordinate
    6.             set {y.cord} to player's y-coordinate
    7.             set {z.cord} to player's z-coordinate
    8.             set {x.cord} to round({x.cord})
    9.             set {y.cord} to round({y.cord})
    10.             set {z.cord} to round({z.cord})
    11.             replace all ":loc:" with "&a[%{x.cord}%, %{y.cord}%, %{z.cord}%]&r" in {_message}
    12.             send "&8%player%: &7&o%{_message}%" to arg 1
    13.         else:
    14.             send "&8%player%: &7&o%arg 2%" to arg 1
     

Share This Page

Loading...