Jump to content

Question For *Smart* People only


Recommended Posts

When you loop say.. a zombie yes, when you loop a zombie does the looped zombie get stored to the server memory? And if so, wouldn't it after a while start to lag the server. Ik, pretty dumb question but that's why I'm asking from smart people only.

 

Link to comment
Share on other sites

4 hours ago, AttePatte said:

When you loop say.. a zombie yes, when you loop a zombie does the looped zombie get stored to the server memory? And if so, wouldn't it after a while start to lag the server. Ik, pretty dumb question but that's why I'm asking from smart people only.

 

take this skript for an example:

command /killzombies:
	trigger:
		loop all zombies in world("world"):
			kill loop-entity
		send "&aAll zombies killed!"

It will loop all the zombies in the world with the name "world". Once it loops through all the zombies it forgets about the loop ever happening, not saving any information into the server memory.
Here's another example:

command /killzombies:
	trigger:
		loop all zombies in world("world"):
			add loop-entity to {Zombies::*}
		kill {Zombies::*}
		clear {Zombies::*}
		send "&aAll zombies killed!"

Once the loop is done in this skript, all the zombies will be saved into a variable, where only then will it get saved into a file (variables.csv). Then when it kills the zombies after the loop, it will then clear the variable, removing any data regarding the already dead zombies.

  • Thanks 1

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Owner of Lifestealed, Exploratory, Encore, UNOfficially and Observed
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - 5/8/2024

[MOD] 5/8/2024 - Present

 

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...