So I recently decided to make a script that lets a player punch with animation and deal dmg
I was able to make the punch animation work with the Q key (even did the debounce with the help of a friend) but I couldnt do the damage part anyone mind helping me with that
This is my script
local userInputService = game:GetService("UserInputService")
local replicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://4588745607'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim.Priority = Enum.AnimationPriority.Action
function debounce(func)
local isRunning = false
return function(...)
if not isRunning then
isRunning = true
func(...)
isRunning = false
end
end
end
userInputService.InputBegan:Connect(debounce(function(input)
if input.KeyCode == Enum.KeyCode.Q then
PlayAnim:Play()
wait(0.75)
PlayAnim:Stop()
wait(0.25)
end
end))
How can I implement a damage script to this?

1 comment
So you just need damage?