29.03.2019, 21:31
What your loop does is repeatedly show and hide it for every spawn point.
Assume you're at Spawn Point ID 2, the loop will hide the TD for ID 0 and 1, then show it for 2 and then hide it again at 3, 4 and 5. So in the end it will still be hidden. Theoretically only the last one works at the moment.
What you need to do is stop the loop when a Spawn Point was found, and only hide it if none of the Spawn Points are near the player (so after the loop finished).
You can use a variable declared before the loop to keep track of which one was found, and if one was found at all, then act accordingly.
Sorry for the earlier replies, I mistook i for j in the TD code.
Assume you're at Spawn Point ID 2, the loop will hide the TD for ID 0 and 1, then show it for 2 and then hide it again at 3, 4 and 5. So in the end it will still be hidden. Theoretically only the last one works at the moment.
What you need to do is stop the loop when a Spawn Point was found, and only hide it if none of the Spawn Points are near the player (so after the loop finished).
You can use a variable declared before the loop to keep track of which one was found, and if one was found at all, then act accordingly.
Sorry for the earlier replies, I mistook i for j in the TD code.