Problems with code for spawning mobs from list.

  • 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 comminuty!

    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.

AwesomeGunGuy

New Member
Mar 5, 2018
5
0
0
29
code_language.skript:
on disconnect:
    loop all creatures in radius 15 of player:
        add loop-creature to {%player%::Test::*}
        send "%{%player%::Test::*}%" to console
on Join:
    spawn all elements of {%player%::Test::*} at player's location

Hi all,
I am trying to add all mobs in a radius of 15 of a player who disconnects to a list.
So that I can spawn them in if they reconnect.

But the code gives an error. The disconnect part seems to work though
Please help me.

Thanks in advance.
 
code_language.skript:
on disconnect:
    loop all creatures in radius 15 of player:
        add loop-creature to {%player%::Test::*}
        send "%{%player%::Test::*}%" to console
on Join:
    spawn all elements of {%player%::Test::*} at player's location

Hi all,
I am trying to add all mobs in a radius of 15 of a player who disconnects to a list.
So that I can spawn them in if they reconnect.

But the code gives an error. The disconnect part seems to work though
Please help me.

Thanks in advance.
Damn my crystal ball ran out of batteries... sorry I guess you’re gonna have to post the error
 
The last line just does not work.
It gives at players location is not a valid item data.

If you leave ''all elements of'' out of the code It will not give an error but also not spawn anything.
So the problem is that I Dont know how to spawn creatures that are added to a list.

But my main goal is actually to solve a problem, that is that mob's are despawning on disconnect.
I don't want them to despawn on disconnect but I do want them to despawn in all other situations.
So if you can think of any other workaround than this, that could also help.
 
code_language.skript:
on disconnect:   
    loop all creatures in radius 15 of player:
        add ("%loop-value%" parsed as entity type) to {mobs::%player%::*}

on join:
    spawn {mobs::%player%::*} at player
    clear {mobs::%player%::*}
 
Status
Not open for further replies.