Posted By: Ayumi
While in Trigger event - 11/23/16 07:49
Hey,
i have tryed to set a while in TRIGGER_EVENT and wait for SHOW/Hide Panel.
The while should go through until 0 is reached but this only works with wait (-1);
If wait(1);, the while only runs once.
Why?
i have tryed to set a while in TRIGGER_EVENT and wait for SHOW/Hide Panel.
The while should go through until 0 is reached but this only works with wait (-1);
If wait(1);, the while only runs once.
Why?
Code:
var pressed = 0; action DsTrigger() { my.emask |= (ENABLE_TRIGGER); my.trigger_range = 222; my.event = DsTriggered; } void DsTriggered() { if(event_type == EVENT_TRIGGER) { RaiseDsTrigger(); } } void RaiseDsTrigger() { var dist = abs(vec_dist(player.x, my.x)); if(dist < 244) { set(DsPanelE, SHOW); if(pressed == 0) { pressed++; while(pressed > 0) { if(key_pressed(18)) { if(pressed == 2) { wait(-1); reset(DsPanel, SHOW); pressed = 0; } if(pressed == 1) { reset(DsPanelE, SHOW); wait(-1); set(DsPanel, SHOW); pressed++; } } wait(1); } } } else reset(DsPanelE, SHOW); }