Cooldown on "send"

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

wrymain

Member
Feb 20, 2025
37
0
6
So this is my skript:

Python:
on break of coal ore:
    if player is in "world":
        cancel event
        set event-block to stone
        send "&eMine di &f""&a/warp resources&f""" to player

it'll be really spammy if the player encounters more than one ore, it could spam the player's chat. how do i add a cooldown for it so it doesn't spam even if the player is mining multiple ore in a second?
 
Alternatively you could use a variable and something like this:
Code:
...
if {_wait} = 0
    send "&eMine di &f""&a/warp resources&f""" to player
    set {_wait} to 1
    wait 5 seconds
    set {_wait} to 0
 
just slap mining fatigue on them once they break the coal

this should work:
code_language.skript:
on break of coal ore:
    if player is in "world":
        cancel event
        set event-block to stone
        send "&eMine di &f'&a/warp resources&f'" to player
        apply potion of mining fatigue of tier 3 to the player for 999 days
        set {warn::%player%} to 1

on block damaging:
    if block is coal ore:
        if {warn::%player%} is greater than 0:
            send "&eMine di &f'&a/warp resources&f'" to player
            apply potion of mining fatigue of tier 3 to the player for 999 days
        else:
            remove mining fatigue from the player
 
Last edited:
just slap mining fatigue on them once they break the coal

this should work:
code_language.skript:
on break of coal ore:
    if player is in "world":
        cancel event
        set event-block to stone
        send "&eMine di &f'&a/warp resources&f'" to player
        apply potion of mining fatigue of tier 3 to the player for 999 days
        set {warn::%player%} to 1

on block damaging:
    if block is coal ore:
        if {warn::%player%} is greater than 0:
            send "&eMine di &f'&a/warp resources&f'" to player
            apply potion of mining fatigue of tier 3 to the player for 999 days
        else:
            remove mining fatigue from the player
wont that be inconvenient? some players wants to build something underground, and those coals are in the way.
 
So this is my skript:

Python:
on break of coal ore:
    if player is in "world":
        cancel event
        set event-block to stone
        send "&eMine di &f""&a/warp resources&f""" to player

it'll be really spammy if the player encounters more than one ore, it could spam the player's chat. how do i add a cooldown for it so it doesn't spam even if the player is mining multiple ore in a second?
Hey, i guess you can do something like this:
Code:
on load:
    set {Wait_Time} to 2 minutes

on break of coal ore:
    if player is in "world":
        cancel event
        set event-block to stone
        if {message::%uuid of player%} is not set:
            send "&eMine di &f""&a/warp resources&f""" to player
            set {message::%uuid of player%} to false
            wait {Wait_Time}
            delete {message::%uuid of player%}
You can adjust your wait time to whatever you want in set {Wait_Time} to 2 minutes
 
wont that be inconvenient? some players wants to build something underground, and those coals are in the way.
I have updated some logic keep in mind I have not tested this in game so there may be some bugs, but it passed skParser.
code_language.skript:
on break of coal ore:
    if player is in "world":
        cancel event
        set event-block to stone
        send "&eMine at &f'&a/warp resources&f'" to player
        apply potion of mining fatigue 3 to the player for 999 days
        set {warn::%player%} to max(1, {warn::%player%})

on block damaging:
    if block is coal ore:
        if {warn::%player%} is set:
            send "&eMine at &f'&a/warp resources&f'" to player
            apply potion of mining fatigue 3 to the player for 999 days
        else:
            remove mining fatigue from the player