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

Solved Set the value to the player's last message

Discussion in 'Skript' started by Flajakay, Dec 2, 2018.

  1. F

    Flajakay Active Member

    Joined:
    Jul 29, 2018
    Messages:
    42
    Likes Received:
    1
    Set {_lastmessage} to the player's last message. How can I do it?
     
  2. Dave

    Dave Active Member

    Joined:
    Jul 20, 2018
    Messages:
    31
    Likes Received:
    0
    --- Double Post Merged, Dec 7, 2018, Original Post Date: Dec 7, 2018 ---
    Code (Skript):
    1. on chat:
    2.     set {_lastmessage.%player%} to message
    3.  
    4. command /seelastmessage [<offline player>]:
    5.     trigger:
    6.         if arg-1 is not set:
    7.             send "&7Your last message was: &6%{_lastmessage.%player%}%"
    8.         else:
    9.             send "&6%arg-1%&7's last message was: &6%{_lastmessage.%arg-1%}%"
     
    #2 Dave, Dec 7, 2018
    Last edited: Dec 7, 2018
  3. ShaneBee

    Supporter +

    Joined:
    Sep 7, 2017
    Messages:
    1,479
    Likes Received:
    96
    variables starting with an underscore {_example} are local to the event.
    Meaning that variable would NOT be saved, and the command would not work
     
  4. Dave

    Dave Active Member

    Joined:
    Jul 20, 2018
    Messages:
    31
    Likes Received:
    0
    I did not know since I stopped using skripts and went back to Java.
     
Loading...