#Damage For Punch Animation

7 messages · Page 1 of 1 (latest)

uneven frigateBOT
#

studio** You are now Level 1! **studio

agile pecan
#

you need to show your script code

#

or we cant help you

limpid flare
#

local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- Replace this with the actual Animation ID or the asset's name if stored in ReplicatedStorage
local animationId = "rbxassetid://112690042981985"

-- Cooldown duration in seconds
local cooldownTime = 1.5
local lastClicked = 0 -- Time of the last click

UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
-- Ignore if the input was already processed (e.g., UI or chat input)
if gameProcessedEvent then return end

if input.UserInputType == Enum.UserInputType.MouseButton1 then
    -- Left mouse button click
    local currentTime = tick()  -- Get the current time

    -- Check if the cooldown period has passed
    if currentTime - lastClicked >= cooldownTime then
        local player = game.Players.LocalPlayer
        local character = player and player.Character

        if character and character:FindFirstChild("Humanoid") then
            local humanoid = character.Humanoid

            -- Create an animation instance using the animation ID
            local animation = Instance.new("Animation")
            animation.AnimationId = animationId

    
local animationTrack = humanoid:LoadAnimation(animation)
            animationTrack:Play()

            -- Update lastClicked time to prevent another click until the cooldown is over
            lastClicked = currentTime
        end
    else
        -- Optionally, you can give feedback to the player about the cooldown, e.g.:
        print("Please wait for the cooldown to finish.")
    end
end

end)

plain pivot
#

so like what did you try

limpid flare
little lichen
#

nothing about that code creates a hitbox