I’m making a damage part and making it so one player has a cooldown applied to them so other players can get hit by the part while its on cooldown for another player.
The thing is, it completely ignores the cooldown and instantly kills the player rapidly.
Script:
script.Parent.Touched:Connect(function(hhsh)
local hits = {}
if game.Players:GetPlayerFromCharacter(hhsh.Parent) then
local char = hhsh.Parent
if not hits[char] then
hits[char] = true
hhsh.Parent:FindFirstChildWhichIsA("Humanoid"):TakeDamage(5)
task.wait(1)
hits[char] = false
end
end
end)