Key Aspects Used In A Refueling System

Hi developers!

I am trying to script a fuel and refueling script but don’t know where to start. Could somebody please tell me where to start and the key aspects used in a script like this? I am also trying to have a gas pump so when you press a letter, it will refuel. The aim is to do a refueling script like Emergency Response: Liberty County made by @mrfergie

All comments and help are appreciated.

NB: I am not asking for a script but just some reference points to help and the key aspects used.

I never played liberty country, so I don’t know what type of refueling system it has

Here is a picture to get an idea.

They probably use an int value as a percentage to fill up the fuel, and divide the car’s fuel by 100 to get the amount the gui has to be filled, something like this:

local amount = math.abs(car.Fuel/100)
tweenService:Create(carFuelUI, tweenInfo, {Size = UDim2.new(amount, 0, 1, 0}):Play()

also needs to check that the car’s fuel is not more than the fuel chosen

the money needed is probably the (cashPerGallon * numberOfGallons)

3 Likes

correct, and then subtract a very small amount from the fuel value for every half second or so that the throttle is pressed during driving

1 Like

And do you use a chassis on your vehicles or are they custom chassis?