I did the animation and everything but every time I press the key with which it is hit, once I press the key with which I press it does not stop taking life, please help
here is the server scrpt :
local Punch = game.ReplicatedStorage local Aniamtion = game.ReplicatedStorage.PunchFolder.Animation
local PDB = false
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) Punch.Punch.OnServerEvent:Connect(function(Player, Action) print("FIRED")
local humanoid = char:WaitForChild("Humanoid")
char["Left Arm"].Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(1)
wait(1)
hit.Parent.Humanoid:TakeDamage(0)
end
end)
end)
end)
end)
local script in the startercharacterscripts
local USI = game:GetService("UserInputService") local player = game.Players.LocalPlayer local char = player.Character local Hum = char:WaitForChild("Humanoid") local dash = game.ReplicatedStorage:WaitForChild("Union"):Clone() local db = false local anim = game.ReplicatedStorage.PunchFolder.Animation
USI.InputBegan:Connect(function(io,p) if io.KeyCode == Enum.KeyCode.R then if db == false then db = true game.ReplicatedStorage.Punch:FireServer() Hum:LoadAnimation(anim):Play() wait(1.2) db = true
end
end
end)

1 comment
pretty sure that the wait(1) isnt stopping the function from being triggered again