#how do i make cooldown!?

83 messages · Page 1 of 1 (latest)

fallen pollen
#

here are the variables

#

VIARABLES--

#

local debounce = false
local interAttack = false
local attacked = false
local damaged = false

frosty acorn
#

at the start make debounce true

#

then at the end

#

make a task.wait

#

and put the cooldown time

#

then debounce = false

frosty acorn
fallen pollen
#

?

fallen pollen
#

@frosty acorn

#

what should i change rn, idk what you mean @frosty acorn

frosty acorn
#

Blud

fallen pollen
#

i changed it, im trying to make a table right now.

#

but its kinda buggy

frosty acorn
#

Okay firstly instead of using
'If debounce == false then'
Use
'if not debounce then'

#

Put debounce = true right after the ' if not debounce then '

fallen pollen
#

im still working on it

#

im still a beginner so im thinking what next

#

(ive never used a table before)

frosty acorn
#

Then all the way at the end put a task.wait()

#

Then debounce= false

#

And in the brackets of the wait put how long you want the cooldown to be

fallen pollen
#

there is no debounces

frosty acorn
#

Okie dookie

fallen pollen
#

should i add one?

frosty acorn
#

Yes

fallen pollen
#

alright

#

ill let you know after i putted in what you just said

#

@frosty acorn

#

variable is false btw

frosty acorn
#

Yes upvote

fallen pollen
#

it doesnt work sadly

frosty acorn
#

Show full script

#

At the start when U do local debounce= make sure it's false

#

Wait bro wtf have U done

#

Wait

#

Nvm

#

It's good

fallen pollen
#

the script doesnt fit.

#

in the chat

frosty acorn
#

At the start

#

.

#

Hold on

#

You have 2 types of attacks

#

Yes?

fallen pollen
#

--VIARABLES--

local tool = script.Parent

--PLAYER VIARABLES--

local playscr = game:GetService("Players")
local player = playscr.LocalPlayer
local character = player.Character

--ATTACK VIARABLES

local debounce = false --maybe im gonna use it--
local attacked = false
local damaged = false
local cooldown = 0.75

--ANIM VIARABLES--

local Swing1 = script.Parent.Swing1
local Swing2 = script.Parent.Swing2
local EquipAnim = script.Parent.EquipAnim
local IdleAnim = script.Parent.IdleAnim
local Idle = character:WaitForChild("Humanoid").Animator:LoadAnimation(IdleAnim)
Idle:Play()
Idle.Priority=Enum.AnimationPriority.Action4

--EQUIP VIARABLES--

local equiping = true
local equipped = false

--1 COOL VIARABLE--

local handle = tool.Handle

--SCRIPTS------------------------------------------------------------------------------------------------

tool.Equipped:Connect(function()
tool.Handle.Unsheath:Play()

local AnimTrack = tool.Parent:FindFirstChild("Humanoid").Animator:LoadAnimation(EquipAnim)
AnimTrack:AdjustSpeed(1)
AnimTrack:Play()
AnimTrack.Priority=Enum.AnimationPriority.Action3
task.wait(0.18)
Idle:Play()

end)

#

tool.Unequipped:Connect(function()
task.wait(0.02)
Idle:Stop()
end)

#

@frosty acorn

fallen pollen
frosty acorn
#

Istg bro

#

Gimme a sec I'll write the code out for u

fallen pollen
#

k

frosty acorn
#

this isnt the full script?

#

wheres the activated part?

#

and connections

#

u can send it with txt file

fallen pollen
#

alr 1 sec

#

ima send part by part

frosty acorn
#

holy fuck thats so long

fallen pollen
#

--VIARABLES--

local tool = script.Parent

--PLAYER VIARABLES--

local playscr = game:GetService("Players")
local player = playscr.LocalPlayer
local character = player.Character

--ATTACK VIARABLES

local debounce = false --maybe im gonna use it--
local attacked = false
local damaged = false
local cooldown = 0.75

--ANIM VIARABLES--

local Swing1 = script.Parent.Swing1
local Swing2 = script.Parent.Swing2
local EquipAnim = script.Parent.EquipAnim
local IdleAnim = script.Parent.IdleAnim
local Idle = character:WaitForChild("Humanoid").Animator:LoadAnimation(IdleAnim)
Idle:Play()
Idle.Priority=Enum.AnimationPriority.Action4

--EQUIP VIARABLES--

local equiping = true
local equipped = false

--1 COOL VIARABLE--

local handle = tool.Handle

--SCRIPTS------------------------------------------------------------------------------------------------

tool.Equipped:Connect(function()
tool.Handle.Unsheath:Play()

local AnimTrack = tool.Parent:FindFirstChild("Humanoid").Animator:LoadAnimation(EquipAnim)
AnimTrack:AdjustSpeed(1)
AnimTrack:Play()
AnimTrack.Priority=Enum.AnimationPriority.Action3
task.wait(0.18)
Idle:Play()

end)

frosty acorn
#

ok

fallen pollen
#

tool.Activated:Connect(function(hit)

if not debounce then
    debounce = true
    task.wait(0.01)
    Idle:Stop()
    task.wait(0.01)
    tool.Handle.SwordSlash:Play()
    tool.Parent:FindFirstChild("Humanoid").Animator:LoadAnimation(Swing1):Play()
    task.wait(0.80)
    Idle:Play()
else
    task.wait(0.01)
    Idle:Stop()
    task.wait(0.01)
    tool.Handle.SwordLunge:Play()
    tool.Parent:FindFirstChild("Humanoid").Animator:LoadAnimation(Swing2):Play()
    task.wait(0.80)
    Idle:Play()
    
end

script.Parent.Handle.Trail.Enabled = true
script.Parent.Handle.Trail.Lifetime = 0.4

script.Parent.Handle.Trail.Lifetime = 0
script.Parent.Handle.Trail.Enabled = false

task.wait(3)
debounce = false

end)

tool.Unequipped:Connect(function()
task.wait(0.02)
Idle:Stop()
end)

handle.Touched:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid") and attacked == true and damaged == false then
damaged = true
part.Parent.Humanoid:TakeDamage(20)
end
end)

#

done

frosty acorn
#

thats it?

#

oh

#

yh

#

would you like to donate to me

#

because i helped u so much and stuff

#

also come to me directly if u need more help

#

bc then i can charge ur ass

fallen pollen
#

ill pay like 8 robux (all i got) if it works

frosty acorn
#

oh

#

nvm

#

broke ahh

fallen pollen
#

dang

#

its true

#

btw thanks