MCreator issue tracker has been migrated to GitHub.
Existing tickets have been migrated to GitHub. Please open new tickets on the GitHub tracker instead. If you do not have a GitHub account, all feature requests and bug reports from forums are still considered and checked by the maintainers.
You need to use global variable for this, not local. Local means variable that is local per procedure execution, so there get reset each time.
If you are looking on making delay, this video might help: https://www.youtube.com/watch?v=VXAPH0g9A00&list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei&index=21&t=1s