Hi!
So…
I want to make realistic fuel consumption. This should be so that the higher the vehicle speed, the higher the fuel consumption. At the same time, low fuel consumption should exist even when the vehicle is not moving but the engine is running. And at the same time, I want fuel consumption to be adjustable for different vehicles.
The problem is that I’m not strong in math and I can’t figure out how to solve it.
I’ve been looking for solutions, but my problem seems to be rare
Here is the code I currently have.
local speed = math.ceil((math.floor((script.Parent.Parent.MAIN.Velocity).magnitude))/3) * 2
while wait(FuelUsage.Value) do
if Values.EngineOn.Value == true and FuelLevel.Value > 0 and script.Parent.LimitedFuel.Value == true then
FuelLevel.Value = FuelLevel.Value - 1
end
end
This can seem very confusing. Ask if you don’t understand something.
Thanks!