That node cannot remember its state because every time the function runs, it uses a brand new node - so to speak. Either place it outside of the function or use a Boolean that can live outside of the function’s scope.
A better question here is: Must we run this on Tick? Perhaps there’s a better way - an event driven one.