So I made a punch system where you have a combo of 4 attacks and at the 4th its resets it resets also if I dont attack for 2.8 secounds the problem is its still reseting if I do the first punch right before it I add a video the numbers in the output is the combo I have and it prints combo reset if the combo resets
--//--change Combo--//--
local function resetCombo(char)
local currendcombo = char:GetAttribute("combo")
wait(2.8)
if char:GetAttribute("combo") == currendcombo then
print("combo reset")
char:SetAttribute("combo", 1)
end
end
local function changeCombo(char)
if char:GetAttribute("combo") < 4 then
char:SetAttribute("combo", char:GetAttribute("combo") + 1)
elseif char:GetAttribute("combo") == 4 then
char:SetAttribute("combo", 1)
end
task.spawn(function()
resetCombo(char)
end)
end
``` this is the funtion to change the combo after an punch so it just makes the attribute in the plr one higher and plays the combo reset thing after it to see if the combo gets reset