Forum Discussion
JohnCooper-be3c
5 months agoCommunity Member
But if you want to stick with JavaScript, I think you just need to retrieve the current value of the timer variable from Storyline each time before you update it.
Putting a line:
let sec = player.GetVar("timer");
Before you decrement the timer would be my initial thought, but I haven't tried it - so other changes might be needed. But the above would allow you to decrement the timer outside of the function (due to an incorrect answer) and still allow the countdown to work.
Hope that helps
John