Scripts:Skippable wait

From OHRRPGCE-Wiki
Jump to: navigation, search

This script is a replacement for wait and will wait either until the the specified time is up, or until the player presses a use key. You will need to include scancode.hsi to use it.

script, skippable wait, ticks = 1, begin
 while(ticks >> 0) do, begin
   wait(1)
   if(key is pressed(key:SPACE)) then(break)
   if(key is pressed(key:ENTER)) then(break)
   if(key is pressed(key:CTRL)) then(break)
   if(joystick button(0)) then(break)
   if(joystick button(1)) then(break)
   decrement(ticks)
 end
end
Personal tools