Solved on chat

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

Pykaxe

Member
Jul 26, 2017
32
1
0
How to make a script that will say

"Do not send the same message twice"

if you say something twice in chat.
 
I actually just made a skript like this for myself.:emoji_grinning: it has a 30 second timer so that they can say the same thing again in 30 seconds
code_language.skript:
on chat:
    cancel event
    set {_chatcooldown} to difference between {chatcooldown.last.%player%} and now
    if {_chatcooldown} is less than 30 seconds:
        if {chatmessage.%player%} is equal to "%message%":
            send "&e&lThat's the same as your last message. Wait 30 seconds to chat the same thing."
            stop
    set {chatmessage.%player%} to the message
    set {chatcooldown.last.%player%} to now
 
  • Like
Reactions: Pykaxe
if it is more than 30 seconds, how do i delete the variable
 
if it is more than 30 seconds, how do i delete the variable
eeeeh possibly like this with an else statement. It would have to recreate it on the next chat though, so deleting it would be pretty pointless.
code_language.skript:
if {chatmessage.%player%} is equal to "%message%":
    send "&e&lThat's the same as your last message. Wait 30 seconds to chat the same thing."
    stop
else:
    delete {chatcooldown.last.%player%}
    delete {chatmessage.%player%}
It's only two variable per player that get saved, so it's not going to bog down your server if that's what you're worried about
 
Status
Not open for further replies.