Help needed with debouncing!

Hello! Thank you for coming, I have had some problems in my new game because the debouncing system I put in the script is not working.
Screenshot 2022-07-24 at 12.31.33

Try putting lines 42-43 underneath the end at line 38.

I just tried it, yet the parts keep spamming.

You failed to check if dB is false at the start of the Event - line 5

1 Like

You haven’t even set db to true yet so the code isn’t gonna set it back

I thought I did that :confused: I’m not really sure what you mean.

Add this between line 5 and 6

if db then 
return
end

After whatever you want to happen, put db = true because if you set it to true they can’t spam. After that, it is setting it to false but it was never set to true in the first place.

it works now thanks for the help guys :+1:

1 Like