Page 1 of 1

Help destroying items

Posted: Thu Dec 04, 2014 1:30 am
by Goliathan
I would like to make any item get destroyed when putting it in a chest. I'm new to LUA please help. I'm using the dungeon editor LUA not external.

Re: Help destroying items

Posted: Thu Dec 04, 2014 10:22 pm
by mahric
If with "chest" you mean the "treasure chest", this should do it:

1) copy and paste the code below to a script entity.
2) add an "OnInsert" from the chest to the scriptentity you made, pointing to the function "destroyItem"

Code: Select all


function destroyItem(self, item)
	if item then
		item.go:destroy()
	end
end