Xerxes
This was the relevant part because this script has a lot of fixes such as tombstone and map restart, but I ended up fixing it by myself.
In general here's what I did:
player thread noobFriendly();
to
self thread noobFriendly();
on onPlayerConnect() solved the most part of the problem.
Also, moving the call of noobFriendly() from onPlayerConnect() to onPlayerSpawn()
and removing the infinite loop on onPlayerSpawn() because for my script it's simply unnecessary.
I'm a front-end dev with some years of back-end experience and still getting the hang of lua.
We can happily close this thread