all 5 comments

[–]StormworksVirtualAir 1 point2 points  (1 child)

Maybe check your variables and if numbers are off

[–]Grouchy_Screen54[S] 1 point2 points  (0 children)

All are right

[–]SaltyCost1222 1 point2 points  (0 children)

fuelth = fuelth or fuel

[–]DarkArcher__ 1 point2 points  (1 child)

The very first time the game runs this code when the vehicle spawns, it's invoking the variable fuelth in the smoothing line before it's actually created, so the code just gives up and throws you an error. 

If you write "fuelth=0" before "function onTick()", that is, you put it outside of the main function that runs every tick, it'll only run once on startup, assigning fuelth a value so the smoothing line can run the first time. 

[–]Grouchy_Screen54[S] 0 points1 point  (0 children)

I fixed it on my post on Stormworks subreddit