#cooldown struggles

8 messages · Page 1 of 1 (latest)

wanton glen
#
-- anim play

local cooldownDuration = 1 -- Cooldown duration in seconds
local lastActionTime = 0
local player = game.Players.LocalPlayer
local userInputService = game:GetService("UserInputService")


local function onKeyPress(input)
    local currentTime = os.time()
    if input.KeyCode == Enum.KeyCode.LeftControl and (currentTime - lastActionTime) >= cooldownDuration then
        local currentpos = player.Character.HumanoidRootPart.Position
        local humanoid = player.Character:WaitForChild("Humanoid")
        local animation = Instance.new("Animation")
        animation.AnimationId = "rbxassetid://17074775260"
        local animationTrack = humanoid:LoadAnimation(animation)
        animationTrack:Play()
        lastActionTime = currentTime
    end
end

userInputService.InputBegan:Connect(onKeyPress)
terse walrus
#

are os.time and tick is the same

tropic bough
maiden sphinx
maiden sphinx
wanton glen
#

also i figured out the issue a while ago im sorry