Code: Select all
-- The coinslot consumes one coin with each click, decrementing coinsNeeded by 1
-- each time, until it reaches 0. Connectors added to the lock will trigger
-- every time a coin is inserted. Connectors added to coinsNeeded will trigger
-- only when all of the required coins have been inserted. Once coinsNeeded
-- reaches 0, additional coins will not be consumed.
-- If you wish for the lock to consume an infinite number of coins, set the
-- coinsNeeded value to a negative number.
There are also several examples of how to use dm_lock_coinslot in the example dungeon.