was wondering if this is even posable if useful.
timertable ={}
-- do the bellow code for every situation you want to detect
timertable[1] = "on pg1"
timer.Create("phone pg1",0,1, function() (print "phone pg1 timer called or started and we did something ?") end)
timer.stop("phone pg1") -- stopped the timer because we don't want to run it when we make it
--do the above code for every situation you want to detect and do something about it
function timers(situation) -- opens the function because we want to be able to call this level 1
if oldsituation = situation then return end -- we don't want the same solution so exit ps could cause problems on redundant calls
for k,v in pairs(timertable) do -- pulls up the timer table level 2
if situation = timertables[v] then -- checks of the situation we are in is the solution that we are checking level 3
timer.Start(situation) -- starts the solution
oldsituation = situation -- prevents us from doing the solution again with out finding another solution first
break -- we found a solution stop
end --level 3
end --level 2
end -- exit function level 1