Page 1 of 1

How to find out which item was launched in the rocket

Posted: Mon Apr 02, 2018 10:02 pm
by WIZ4
How to find out which item was launched in the rocket in event on_rocket_launched?

Re: How to find out which item was launched in the rocket

Posted: Mon Apr 02, 2018 10:18 pm
by Klonan
WIZ4 wrote:How to find out which item was launched in the rocket in event on_rocket_launched?
You can check the rocket inventory:

Code: Select all

function on_rocket_launch(event)
  local rocket = event.rocket
  local inventory = rocket.get_inventory(1)
  local contents = inventory.get_contents()
  game.print(serpent.block(contents))
end

Re: How to find out which item was launched in the rocket

Posted: Mon Apr 02, 2018 10:29 pm
by WIZ4
Thanks!

Re: How to find out which item was launched in the rocket

Posted: Tue Apr 03, 2018 6:03 pm
by eradicator

Code: Select all

local inventory = rocket.get_inventory(1)
Why does that inventory not have a defines.inventory name?