How to make a no rush like script?

Hi,

I’m am searching the function that disable attack for player, to make a no rush mod like.

Thanks in advance