Freamee 0 Posted November 14 I have an array with an object, but i want to delete it from another command. But its not working, due invalid function (destroy) let mit = { x: player.position.x, y: player.position.y, z: player.position.z, ent: mp.objects.new(3469410940, new mp.Vector3(player.position), { rotation: new mp.Vector3(0,0,90), alpha: 255, dimension: player.dimension }) } let igen = JSON.stringify(mit); hulla.push(JSON.parse(igen)); hulla.forEach((entity, index) => { if(player.IsInRange(entity.x, entity.y, entity.z, 10)) { result = true; player.pushChat(`törölve: (${index}) ${entity.ent}`); hulla.splice(index, 1); entity.ent.destroy(); } Share this post Link to post Share on other sites
LeonMrBonnie 5 Posted November 14 Why are you calling stringify and then parse? Stringify removes all functions of an object. Just push the created object into the array directly. Share this post Link to post Share on other sites
Freamee 0 Posted November 15 21 hours ago, LeonMrBonnie said: Why are you calling stringify and then parse? Stringify removes all functions of an object. Just push the created object into the array directly. Appreciate your help. :3 Share this post Link to post Share on other sites