Hello, im new to scripting and i'd like to ask how im supposed to add a cooldown GUI to this script. Btw the cooldown time is set to 6 seconds.
--Made By 123Marooxd123
local lleg = script.Parent:FindFirstChild("Left Leg")
local rleg = script.Parent:FindFirstChild("Right Leg")
local db = true
local UIS = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local DropAnim= Instance.new("Animation")
DropAnim.AnimationId = "rbxassetid://9661495094"
local dmg = false
local CanDropkick = false
local Keybind = Enum.KeyCode.E
local LeftLeg = game.Players.LocalPlayer.Character["Left Leg"]
local RightLeg = game.Players.LocalPlayer.Character["Right Leg"]
local topspeed = 20
character.Humanoid.Running:Connect(function(speed)
if speed > topspeed then
CanDropkick = true
dmg = true
else if speed < topspeed then
CanDropkick = false
dmg = false
end
end
end)
function dmg(hit)
if not CanDropkick then return end
if hit.Parent ~= nil then
local hum = hit.Parent:findFirstChild("Humanoid")
if hum ~= nil then
hum.Health = hum.Health -10
end
end
end
lleg.Touched:connect(dmg)
rleg.Touched:connect(dmg)
UIS.InputBegan:Connect(function(input,gameprocessed)
if gameprocessed then return end
if not CanDropkick then return end
if not dmg then return end
if not db then return end
if input.KeyCode == Keybind then
CanDropkick = false
dmg = true
db = false
local playAnim = character.Humanoid:LoadAnimation(DropAnim)
playAnim:Play()
local drop = Instance.new("BodyVelocity")
drop.MaxForce = Vector3.new (1,0,1) *30000
drop.Velocity = character.HumanoidRootPart.CFrame.lookVector * 85
drop.Parent = character.HumanoidRootPart
for count = 1, 8 do
wait(0.13)
drop.Velocity*= 0.5
end
playAnim:Stop()
drop:Destroy()
CanDropkick = true
wait(6)
dmg = false
db = true
end
end)

1 comment
Thank you, although I think you misunderstood my question. What im trying to make is a gui that shows you how long you have to wait before you can perform your ability