Scripting Moderators thisdp Posted August 29, 2015 Scripting Moderators Share Posted August 29, 2015 I want to create a 25 ms loop but I noticed one problem. local timer = {} addEvent("onClient25MsLoop",true) timer[1] = setTimer(function() timer[2] = setTimer(function() triggerEvent("onClient25MsLoop",root) end,50,0) end,50,1) timer[3] = setTimer(function() timer[4] = setTimer(function() triggerEvent("onClient25MsLoop",root) end,50,0) end,75,1) addEventHandler("onClient25MsLoop",root,function() outputChatBox(getTickCount()) ----------every output should differ by 25 ms end) setTimer(function() killTimer(timer[2]) killTimer(timer[4]) end,2000,1) Well,I set two 50-ms-loop timers.One with 50 ms delay and the other with 75 ms delay(they differ by 25 ms).At first several milliseconds,they work prefect,but after a second,they go wrong. The 25-ms-difference become invalid. Link to comment
JR10 Posted August 29, 2015 Share Posted August 29, 2015 Why don't you just use onClientRender with getTickCount? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now