I am pretty sure it's mod PE script, judging by the section this was created in.
But, if you want to time in JS you may want setInterval or setTimeout. I am not sure about mod PE script though. Check out: http://www.w3schools.com/js/js_timing.aspNvm, didn't see this was already mentioned
//20 ticks in modtick = 1 second
var ticks = 100
function modTick()
{
ticks--;//will take 20 off ticks every 1 second
if(ticks==0)
{
//do somestuff or trigger something with a variable
}
}
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
if( blah blah) wait then do this ? In javascript ?
lie
if(blockId==1)
the time code
the function
var Timer; var TotalSeconds; function CreateTimer(TimerID, Time) { TotalSeconds=Time; Timer = document.getElementById(TimerID); TotalSeconds = Time; UpdateTimer(); setTimeout("Tick()", 1000); } function Tick() { TotalSeconds -= 10; if (TotalSeconds>=1) { UpdateTimer(); setTimeout("Tick()", 1000); } else { clientMessage(" Test "); } }This is JavaScript or MCP java?Never mind, I can't code JavaScript
Willing to work on Android apps or multi-platform games, see profile bio for information.
Founder and CEO of Temena Development
Twitter: @TemenaPE
Instagram: @ItsLiterallyMath
-
View User Profile
-
View Posts
-
Send Message
Retired StaffBut, if you want to time in JS you may want setInterval or setTimeout. I am not sure about mod PE script though. Check out: http://www.w3schools.com/js/js_timing.aspNvm, didn't see this was already mentioned
//20 ticks in modtick = 1 second var ticks = 100 function modTick() { ticks--;//will take 20 off ticks every 1 second if(ticks==0) { //do somestuff or trigger something with a variable } }