I’ve been checking out RottenV’s last released zombiespawner.lua (and all the other spawners). I got everything working by removing this for loop, but I want to know why this loop is here and what exactly it does.
Basically the script as-is never gets into this for loop. I’m assuming because the table players is empty? I have little coding knowledge, I’m just making guesses and wondered if someone could explain it. The script begins with:
players = {}
RegisterNetEvent("Z:playerUpdate")
AddEventHandler("Z:playerUpdate", function(mPlayers)
players = mPlayers
end)
and loads fine up to this point.
for _, player in pairs(players) do
Wait(1)
end
I’m just trying to understand the significance and whether or not I truly need this in a spawning script.