Author Topic: OnPlayerTouch that only gets called once.  (Read 1023 times)

Name says it all. I'd like to have an input event for a minifig touching a block and it sends it once, and doesn't repeat.

You could use the variable events to check if they already touched the brick.


Lock that topic so nobody post's there.
(Talking to Friendly Fire)

Ensure that the first event here is the first event on the brick, or the Enabled parts will not work. You might also need to adjust things if the event you want needs a delay, using relays/etc.
Code: [Select]
Enabled - Delay 0 - onPlayerTouch - [DO WHATEVER YOU WANT]
Enabled - Delay 0 - onPlayerTouch - Self - setEventEnabled - [0], [Disabled]
Enabled - Delay 0 - onPlayerTouch - Self - cancelEvents
Enabled - Delay 400 - onPlayerTouch - Self - setEventEnabled - [0], [Enabled]

The event should call once when a player touches the brick, and not be called again until players move off the brick.

Yeah, but Space Guy, that would only work for one person.