Script Cooldown?

Store the state in a variable, declared outside of the function:

local isOnCooldown = false

When you start the function, do this:

if isOnCooldown then return end
isOnCooldown = true
task.delay(3, function() isOnCooldown = false end)

Oops, sorry the replies didn’t load for me until I posted.

i mighht just give up on this script i have no idea what to do

I don’t want to give you the whole answer so here’s an example. Exactly how Cairo said it.

You need to keep a reference of the time you first ran your block function. The reference needs to be outside the body of the function so that it’s reference lives throughout the program.

local timeSinceLastBlock = nil -- will store the time when you execute block
local BLOCK_COOLDOWN_TIME = 3
module.Block... blah blah
    -- conditional statement to check the last time you ran this function
    -- if timeSinceLastBlock ~= nil and ( tick() - timeSinceLastBlock ) < BLOCK_COOLDOWN_TIME then
    -- return
    -- timeSinceLastBlock = tick()

Also can you give us any feedback on any errors or what you do not understand? Like I said we are giving examples. These should work if implemented in the correct areas.