Attack is spamable despite conditions

.Ended, Also I tried but it doesn’t register that.

I had a quick skim at the code and I think it may be due to resetCombo? As it’s task.delay the player can click again. I may be stupid but. Why don’t you debounce? Like this:

part.Touched:Connect(function(basepart)
if debounce == false then
debounce = true -- Instantly makes it true meaning players can't mess with the touch event
-- Do your code here
task.wait(3)
-- Reset your combo here
debounce = false -- Now the if statement can run again
end
end)

Edit: If the wait isn’t as exact as the wait in task.wait you can do task.wait(animation.length)

Wouldn’t task.delay make it play LATER as opposed to making it spamable?

But the thing is, players can click over and over again which would make em delay again and again.

That is a good point. I will look into this.

Pretty sure she wants it like that so you wouldnt be able to click once and again 10 seconds latter to get the other punch

Yeah so you can see in the code sample the if statement can’t be messed with as the debounce is already true however the if statement will still run once as long as it met its condition first it just won’t run the second time if the condition is false.

Yeah I may be dumb but I’m pretty sure it’s because she isn’t debouncing and stuff. task.delay only just means you can click over and over and it’ll do the delay over and over so it wouldn’t work.

the get attribute part wouldnt be a type of debounce?

Yeah true lol, like I said I took a quick skim I missed that part out. But I think it’s worth a try for the debounce route anyway.

this?

		if typing or attacking or stunned then return end

My debounce was in the form of waiting until the Attribute, ‘Attacking’ was gone, this is because there are other scripts that will make this attribute True and communicate which moves can be used when and how.

Is it solved now? hopefully it is

I’m still genuinely clueless on what to do ;-;

Yeah that makes sense then, sorry I took a quick skim since I’m doing other stuff currently right now but trying to help at the same time. But the attribute changed signal event seems sort of strange. Why is it inside of the userinput event? That could be a possible issue.

AttributeChangedSignal? Wait, where?

Also you’re completely fine. Don’t stress about it.

I meant this lol, sorry not attributechangedsignal, reached signal.

Oh, Please elaborate if you can! I never knew that those shouldn’t go in UIS

Nah it might not be a problem I just remember when I was new I would put the event inside of an event and it sometimes messed up some things. If your event still works outside of the userinputbegan event then try doing it outside.