Help destroying items

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
Goliathan
Posts: 1
Joined: Thu Dec 04, 2014 1:26 am

Help destroying items

Post 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.
User avatar
mahric
Posts: 192
Joined: Sun Nov 04, 2012 3:05 pm

Re: Help destroying items

Post 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
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Post Reply

Return to “Mod Creation”