#Block(f) Cooldown
144 messages · Page 1 of 1 (latest)
** You are now Level 3! **
It depends of your cods
cods?
u mean codes or is cods smth (idk im new)
The cooldown function is mostly several part
- Declaration of the cooldown Boolean variable
- Checks if the cooldown is on, to not execute your function
- Set the cooldown to true
- Use task.delay to make your cooldown off after a X amount of seconds
Code*
i understand i think but whats the layout how i need to type it?
For example
local cooldown = false
local function OnAction()
if cooldown then return end
cooldown = true
task.delay(X_AMOUNT_OF_SECONDS, function() cooldown = false end)
-- ... Do stuff
end
Replace the X_AMOUNT_OF_SECOND by your time to wait in seconds
So you see it's not drag and drop code
local cooldown = false
local function OnAction(f)
if cooldown then return end
cooldown = true
task.delay(q, function() cooldown = false end)
end
should this work?
bcz blocking is on my f key
Yes but define "q"
o
And if q is 2 for example, then for the next 2 seconds after calling this function for the first time you won't be able to call it again
lol i didnt see that ty
Np lol
local cooldown = false
local function OnAction(f)
if cooldown then return end
cooldown = true
task.delay(1, function() cooldown = false end)
end
this should work then
Yes but it won't do anything
You should add a code after the task.delay to show it works
Like a print
the on action is the key u need to press right?
make it simpler, he’s obviously not very experienced
@frigid shore send ur code

It's pretty simple tho
I explained everything step by step
of what i have now with help of him?
@frigid shore yo what’s task.delay do
?
.
Ok you're right my bad
I should have explained what's task.delay
it makes a delay for a task
right?
remember to have a cancel so it doesnt stack up if he spams it
Well task.delay will thread a function and execute it after an N amount of timd
if cooldown then return end
It won't if there is the cooldown
No ?
Since it returns it doesn't stack up
yes, but u can execute more code while it is delaying.
So there is no waste of memory
yea he said it was a threaded function
o ye
i just want like u press f u need to wait 1 sec
i was thinking of buffs
it’s threaded tho
should i make a recording of how its like now?
Man userinput service
@kind onyx what did u do to obtain S2? Im just curious.
so u just need debounce
I was talking about the OnAction not the callback
i just sent in a module
for a blue lock game
its that easy?
gameplay mechanics
no it was a lot
what should i do for s2
I did the same for S3 but got refused and they said "it worth S2"
basically get banned
💀
then apply again

yh k
1 sec
shlawg done sent a wmv
look
@frigid shore
ffmpeg -i input.wmv -c:v libx264 -crf 23 -c:a aac -q:a 100 output.mp4
bruh wrong file
i saw that same kit on yt
this
u can just spamm block
same but i didnt sell my data to convert.io
lol
no but im for real lol
local UIS = game:GetService(“UserInputService”)
local debounce = false
UIS.InputBegan:Connect(function(input)
—im on phone so i cant indent, im sry
if not input.KeyCode = Enum.KeyCode.F then return end
if debounce then return end
debounce = true
—Your code
task.wait(1)
debounce = false
end)
i know but china alr knows everything prob
lol
so just paste this in a local script?
local UIS = game:GetService(“UserInputService”)
local debounce = false
UIS.InputBegan:Connect(function(input)
if not input.KeyCode = Enum.KeyCode.F then return end
if debounce then return end
debounce = true
task.wait(1)
debounce = true
end)
this
starterplayer>starterplayerscripts>local script?
put it there?
Ye
k
** You are now Level 4! **
Yeye
i exactly pasted this there
local UIS = game:GetService(“UserInputService”)
local debounce = false
UIS.InputBegan:Connect(function(input)
if not input.KeyCode = Enum.KeyCode.F then return end
if debounce then return end
debounce = true
task.wait(1)
debounce = true
end)
but it doesnt work
Yes but it wont do anything
how do i make it give the cooldown?
It has
then why can i still spam block in game?
Where i placed the —Your Code you need to do some code
or is the animation just glitched
U didnt remove old?
wut?
i didnt have an old
The old script that made the old blocking mechanism
ow
Without cooldown
ill look
Where i typed the ‘—you code’, you have to script the functionality
the old at the you code place?
hm ?
this is the code im using for the block
local RunS = game:GetService("RunService")
local Blocking = false
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local Stuns = require(game.ReplicatedStorage:WaitForChild("Combat"):WaitForChild("Stuns"))
local UIS = game:GetService("UserInputService")
Char.ChildAdded:Connect(function()
for i,v in pairs(Stuns) do
if v ~= "Blocking" then
if game.Players.LocalPlayer.Character:FindFirstChild(v) then Blocking = false return end
end
end
end)
RunS.Heartbeat:Connect(function()
for i,v in pairs(Stuns) do
if game.Players.LocalPlayer.Character:FindFirstChild(v) then return end
end
if UIS:IsKeyDown(Enum.KeyCode.F) then
Blocking = true
if Char:FindFirstChild("Blocking") == nil then
script:WaitForChild("RemoteEvent"):FireServer("Start")
end
else
Blocking = false
if Char:FindFirstChild("Blocking") then
script:WaitForChild("RemoteEvent"):FireServer("Stop")
end
end
end)
a friend made it
and idk how tf it works
