#Block(f) Cooldown

144 messages · Page 1 of 1 (latest)

frigid shore
#

Can someone please make a cooldown script for me that i can coppy paste into roblox studio?
or at least help to do it

inner moatBOT
#

studio** You are now Level 3! **studio

frigid shore
#

u mean codes or is cods smth (idk im new)

glass turret
#

The cooldown function is mostly several part

  1. Declaration of the cooldown Boolean variable
  2. Checks if the cooldown is on, to not execute your function
  3. Set the cooldown to true
  4. Use task.delay to make your cooldown off after a X amount of seconds
glass turret
frigid shore
#

k ty

#

ill try to do that

frigid shore
glass turret
#

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

frigid shore
#

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

glass turret
#

Yes but define "q"

frigid shore
#

o

glass turret
#

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

frigid shore
#

lol i didnt see that ty

glass turret
#

Np lol

frigid shore
#

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

glass turret
#

Yes but it won't do anything

#

You should add a code after the task.delay to show it works

#

Like a print

frigid shore
#

the on action is the key u need to press right?

kind onyx
#

@frigid shore send ur code

glass turret
#

It's pretty simple tho

glass turret
frigid shore
kind onyx
#

@frigid shore yo what’s task.delay do

glass turret
glass turret
#

I should have explained what's task.delay

frigid shore
#

right?

neon knot
glass turret
#

Well task.delay will thread a function and execute it after an N amount of timd

kind onyx
#

if cooldown then return end

glass turret
#

No ?

#

Since it returns it doesn't stack up

cold salmon
glass turret
#

So there is no waste of memory

kind onyx
neon knot
frigid shore
#

i just want like u press f u need to wait 1 sec

neon knot
#

i was thinking of buffs

kind onyx
frigid shore
#

should i make a recording of how its like now?

glass turret
cold salmon
#

@kind onyx what did u do to obtain S2? Im just curious.

neon knot
glass turret
kind onyx
#

for a blue lock game

neon knot
kind onyx
#

gameplay mechanics

cold salmon
#

Wow

#

Aight

#

Ima apply for S2 later

kind onyx
neon knot
glass turret
kind onyx
cold salmon
kind onyx
#

then apply again

frigid shore
#

bruh

glass turret
neon knot
#

use google

frigid shore
#

yh k

frigid shore
kind onyx
#

shlawg done sent a wmv

glass turret
#

Use ffmpeg @frigid shore

#

To convert mwv to mp4

frigid shore
#

look

glass turret
#

@frigid shore

ffmpeg -i input.wmv -c:v libx264 -crf 23 -c:a aac -q:a 100 output.mp4
frigid shore
#

bruh wrong file

kind onyx
#

i saw that same kit on yt

frigid shore
glass turret
frigid shore
#

u can just spamm block

glass turret
frigid shore
#

lol

glass turret
cold salmon
# frigid shore look
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)
frigid shore
glass turret
frigid shore
#

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)

cold salmon
#

I misspelled

#

Copy again

#

And yea i think this works

frigid shore
#

k

#

i removed the im on phone and 'yourcode

frigid shore
#

put it there?

frigid shore
#

k

inner moatBOT
#

studio** You are now Level 4! **studio

cold salmon
frigid shore
#

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

cold salmon
#

Yes but it wont do anything

frigid shore
#

how do i make it give the cooldown?

cold salmon
frigid shore
#

then why can i still spam block in game?

cold salmon
#

Where i placed the —Your Code you need to do some code

frigid shore
#

or is the animation just glitched

cold salmon
frigid shore
cold salmon
#

Cuz this script is not made to do anything

#

You didnt script the function

frigid shore
cold salmon
frigid shore
#

ow

cold salmon
#

Without cooldown

frigid shore
#

ill look

cold salmon
#

Where i typed the ‘—you code’, you have to script the functionality

frigid shore
cold salmon
#

Dude i gtg im sry

#

I can help u later

#

Or maybe @glass turret

#

Help you further

frigid shore
#

k

#

alr ty for helping

#

ill just need to figure out how to use it

glass turret
#

hm ?

frigid shore
#

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

kind onyx
#

don’t lie

frigid shore
#

i asked a friend and idk from what he got it

#

he said he made it