Answered by
8 years ago Edited 8 years ago
wait()
isn't very precise, especially with very short times. You need to use a delta time loop to handle this.
Additionally, the only way to combat the latency is to script this using a LocalScript.
02 | { img = 544664857 , rate = . 04 } ; |
03 | { img = 544665861 , rate = . 04 } ; |
04 | { img = 544666597 , rate = . 04 } ; |
09 | local ContentProvider = game:GetService( "ContentProvider" ) |
11 | for _, v in ipairs (frames) do |
14 | ContentProvider:PreloadAsync(images) |
18 | local GUI = script.Parent |
20 | local RenderStepped = game:GetService( "RunService" ).RenderStepped |
25 | local st = tick() + extra |
30 | if t - st > = frames [ i ] .rate then |
31 | extra = t - st - frames [ i ] .rate |
36 | i = (i + 1 )%(#frames + 1 ) |
Delta time usage is a confusing concept to understand, so definitely ask any questions you have about it!
Some references that may be helpful: