function modifyCurrentVehicleFuel(action)
local player = game.Players.LocalPlayer
local character = player.Character
if not character then
return false
end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid or not humanoid.SeatPart then
return false
end
local vehicle = humanoid.SeatPart:FindFirstAncestorOfClass("Model")
if not vehicle then
return false
end
if action == "infinite" then
if vehicle:FindFirstChild("States") then
local states = vehicle.States
if states:FindFirstChild("Fuel") and states.Fuel:IsA("NumberValue") then
states.Fuel.Value = math.huge
return true
end
end
elseif action == "remove" then
if vehicle:FindFirstChild("Fuel") then
vehicle.Fuel:Destroy()
return true
end
end
return false
end
modifyCurrentVehicleFuel("infinite")
modifyCurrentVehicleFuel("remove")UPDATED ON 11/22
JOIN THE GAME, SPAWN THE VEHICLE, EXECUTE THE SCRIPT
No comments yet. Be the first to comment!
1function modifyCurrentVehicleFuel(action)
2 local player = game.Players.LocalPlayer
3 local character = player.Character
4
5 if not character then
6 return false
7 end
8
9 local humanoid = character:FindFirstChildOfClass("Humanoid")
10 if not humanoid or not humanoid.SeatPart then
11 return false
12 end
13
14 local vehicle = humanoid.SeatPart:FindFirstAncestorOfClass("Model")
15 if not vehicle then
16 return false
17 end
18
19 if action == "infinite" then
20 if vehicle:FindFirstChild("States") then
21 local states = vehicle.States
22 if states:FindFirstChild("Fuel") and states.Fuel:IsA("NumberValue") then
23 states.Fuel.Value = math.huge
24 return true
25 end
26 end
27 elseif action == "remove" then
28 if vehicle:FindFirstChild("Fuel") then
29 vehicle.Fuel:Destroy()
30 return true
31 end
32 end
33
34 return false
35end
36
37
38modifyCurrentVehicleFuel("infinite")
39modifyCurrentVehicleFuel("remove")