problem with "is playing" function

I’m creating a game where you have to destroy a bush with some hits.
I don’t want people could spam and destroy it in few seconds, so I’ve done this code… while the soud of the hit is playing you can’t hit again.
the problem is that it causes me lots of error and make me lag. what’s the problem?