I adapted my Punish campers xd! script so that you can use it to trigger whatever kind of stuff you want. It basically lets you define tiles in a level that are triggar zones, and then provides you with three events where you can handle them: one when the triggerzone is entered, one when it is left, and one when its been occupied for longer than your defined limit (you can just put the gameticks column to 0 and ignore that event along with the triggarTime-array, if you want).