[Help Request] Custom Spawner

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Nasawrith

Member
Mar 11, 2017
1
0
0
I am trying to make a custom spawner, I can't seem to get the zombie to spawn at the spawner location unless I want major server lag

every 15 seconds:
loop 300 times:
loop {T2SpawnerList::*}:
if {T2SpawnerList::%loop-number%} is set:
set {_loc} to {T2SpawnerList::%loop-number%}
zombie(2 meteres above {_loc})
set display name of last spawned zombie to "T2"

function zombie(loc: location):
spawn a zombie at {_loc}

every 5 seconds:
loop all players:
loop all blocks in radius 25 of loop-player:
loop-block is light green clay:
loop 300 times:
add location of {T2SpawnerList::%loop-number%} to {T2SpawnerList::*}
 
1. You shouldn't use the periodical event for this kind of stuff, less in the way you're using it, it would be better if you just edit the nbt of the spawners to spawn your custom mobs, you can do this with skStuff (or use an addon like Skellett which has some spawner support).
2. why are you looping 300 times and then looping the list there? That's pointless.
3. the functions needs to be loaded before wherever you're using them or it'll throw a stack trace, and that function is kinda useless because it does something that you already can do in one line.
4. I can't say how inefficient is the last periodical event, you're looping all the players in your server and then looping the blocks around a radius of 25 for each player and then looping 300 times with no reason without a single wait every 5 seconds, your server have to be really good for not crash after doing that.
 
Status
Not open for further replies.