chat history. script error.

  • 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.
This is in general kind of a mess. I'm not even entirely sure what you're trying to do; do you want to store only the last 10 messages the player has sent? If so, this isn't really the best way to do it. You shouldn't really be needing to do separate clears and removes to remove one bit of data (the tenth oldest message). Also, your issue with it not working for repeated messages is because you're indexing by the message:

code_language.skript:
set {chat::history::%message%::*} to player

Aside from it not making sense for you to use a list there (unless you're using it for something that I don't understand), using %message% as the index means it won't add new entries when they send the same message (because it'll just overwrite the same index).
 
This is in general kind of a mess. I'm not even entirely sure what you're trying to do; do you want to store only the last 10 messages the player has sent? If so, this isn't really the best way to do it. You shouldn't really be needing to do separate clears and removes to remove one bit of data (the tenth oldest message). Also, your issue with it not working for repeated messages is because you're indexing by the message:

code_language.skript:
set {chat::history::%message%::*} to player

Aside from it not making sense for you to use a list there (unless you're using it for something that I don't understand), using %message% as the index means it won't add new entries when they send the same message (because it'll just overwrite the same index).
my english is problem. I am updated this discussion.
 
Status
Not open for further replies.