Solved Help with skript on move event spam

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

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

TubeVillager

Member
Jan 29, 2019
28
1
0
23
Hey dear skripters,

I am making a skript in which you can freeze people.
I want to send a message to frozen players when they are trying to move.
But i dont want it to get spammed in their chat so i want to have a delay of 1 second between the messages.
How do i do this?
Here is my code:

on any movement:
if {freeze.%player%} is false:
cancel event
if {@Frozen Notify On Move} is true:
message "{@Prefix} {@Frozen Move Message}" to player
else:
stop
 
Hey dear skripters,

I am making a skript in which you can freeze people.
I want to send a message to frozen players when they are trying to move.
But i dont want it to get spammed in their chat so i want to have a delay of 1 second between the messages.
How do i do this?
Here is my code:

on any movement:
if {freeze.%player%} is false:
cancel event
if {@Frozen Notify On Move} is true:
message "{@Prefix} {@Frozen Move Message}" to player
else:
stop
Code:
on any movement:
    if {freeze.%player%} is false:
        cancel event
    if {@Frozen Notify On Move} is true:
        if {fcounter::%uuid of player%} >= 50:
            message "{@Prefix} {@Frozen Move Message}" to player
            set {fcounter::%uuid of player%} to 0
        add 1 to {fcounter::%uuid of player%}

on script load:
    delete {fcounter::*}
 
trying it rn...
[doublepost=1548846102,1548845857][/doublepost]thanks i editted it a bit and i got this to work:


  1. on any movement:
  2. if {freeze.%player%} is false:
  3. cancel event
  4. if {@Frozen Notify On Move} is true:
  5. if {fcounter::%uuid of player%} >= 50:
  6. message "{@Prefix} {@Frozen Move Message}" to player
  7. set {fcounter::%uuid of player%} to 0
  8. add 1 to {fcounter::%uuid of player%}

  9. on script load:
  10. delete {fcounter::*}
because it should only notify the player if he is frozen so the if frozen notify on move is true had to be under on any movement
 
Status
Not open for further replies.