Jump to content
Igor Q.

Despawn Items - Error

Recommended Posts

Hi

I'm trying to make it so that when a character dies (items are removed from inventory), all items they drop despawn.

5c0601c744e31_Ylandsgrenade.png.0953b135d36163503281b102b41a63bf.png

However if the character contains more than 1 item in the inventory the game code bugs and the character freezes as a ghost and only the first item despawns.

5c06029fd790f_Ylandsgrenade.png.4d4351531e1bec818569298f368754cb.png

 

Any idea on how to fix this?

Share this post


Link to post
Share on other sites

Are you using an event listener for the death? I would. I would send a picture of the code I would use but I’m not at home if you want I’ll send one later but for now I’ll try explain. Despairing the target object would despawn the player and not there items.

Your script should I go like this : 

on trigger

 for each time in array (get inventory player(target object))

inside the loop despawn entity(item)

hope that helps? if you need an image let me know

Share this post


Link to post
Share on other sites

Gonna need a pic for this. It's not working on my end.

Edit: Never mind, need to include character equipment as well.

Ylands grenade.png

Edited by Igor Quintero
  • Like 1
  • Upvote 1

Share this post


Link to post
Share on other sites

Hi

I do not know if it will work for you. but if you apply a player role you have the option to eliminate the inventory when you die.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×