Jump to content

while true loop


Recommended Posts

on spawn of a zombie:
	zombie is alive:
		while true:
			set path targets of event-zombie to location of a random player out of all players
			apply speed 1 without any particles to event-zombie for 5 seconds
			wait 5 seconds

I tried to make it so every 5 seconds it sets the path targets of a zombie to the location of a random player, but there is no output for some reason..? I tried putting broadcast on there as well and it wouldn't broadcast anything. Any advice on what I did wrong?

  • Like 1
Link to comment
Share on other sites

Because there is nothing that is true. What's true? You're saying while true but as far as Skript is concerned, that's a new line that has nothing to do with the zombie. So what is true?

No. You would want to include everything on the same line. As such:


on spawn of zombie:
	set {_e} to last spawned zombie
	while {_e} is alive:
		wait 1 second


Edited by rosathorn
  • Confused 1

rose city STICKER


i code, animate, develop, UI design, learn, and adapt, as well as make servers, of course

💐Joined Minehut sometime in 2014
💐VIP sometime in 2018
💐Legend in January 2021
💐Helper on 4/11/2021
💐♥ (Retired) on 5/17/2021
💐 Moderator on 8/18/2023

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...