Code: Select all
TIME_BETWEEN_STEPS = 3
g_Time = nil
function checkStep()
local now = getStatistic("play_time")
if (g_Time == nil) then
g_Time = now
return
end
local diff = now - g_Time
if (diff < TIME_BETWEEN_STEPS) then
_openTheBlockers()
end
g_Time = now
end
function _openTheBlockers()
print("THIS MUST BE DONE BY SPIDERFIGHTER :)")
end
How it works: it uses getStatistic("play_time") to track how many seconds pass between pressure plates, and if it is below 3 it calls _openTheBlockers