Random NPC spawn

I am trying to find out how to make a NPC spawn at random, during a surtent amount of time. I want to make my NPC’s only spawn during night or day and I have no idea on how to do that. I want to make it so my NPC a zombie that will spawn only at night with a 25% chance of spawning.

You can make a spawner, and make a “Timekeeper”. Put a timer that calls every 40 seconds (for example, change later). Every 40 seconds it casts to the time-keeper and checks the time of day, if time of day = night, then get a random int between 1 and 4, if 1, spawn new actor zombie.