I have a script so that when I touch a cube it takes away its HP
local HP = cube.Healthbar
local function Healtbar() do
HP.Value = HP.Value - 5
end
cube.Touched:Connect(Healthbar)
But HP is taken away too quickly, literally every frame when I encounter the cube, and I would like to have a small pause after taking damage, after which the damage again passed, but a simple wait() - does not work and information on how to do it I have not found anywhere.
Help please, I'm just learning and I definitely can't do it myself.... please
I made it work