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 Help with skript on move event spam

Discussion in 'Skript' started by TubeVillager, Jan 30, 2019.

Thread Status:
Not open for further replies.
  1. T

    TubeVillager Active Member

    Joined:
    Jan 29, 2019
    Messages:
    28
    Likes Received:
    1
    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
     
  2. L

    Joined:
    Jan 26, 2017
    Messages:
    363
    Likes Received:
    19
    Code (Text):
    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.  
    10. on script load:
    11.     delete {fcounter::*}
     
  3. T

    TubeVillager Active Member

    Joined:
    Jan 29, 2019
    Messages:
    28
    Likes Received:
    1
    trying it rn...
    --- Double Post Merged, Jan 30, 2019, Original Post Date: Jan 30, 2019 ---
    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
     
Thread Status:
Not open for further replies.
Loading...