So I've been working on this project, problem is the while loop is acting very strange.
Tool.Equipped:Connect(function()
print(Player)
GUI.Parent = Player.PlayerGui
while FuelLelf == true do
if CurrentFuel ~= 0 then
CurrentFuel = CurrentFuel - FuelDecreaseNum
print(CurrentFuel)
wait()
if FuelLelf == 0 then
wait()
print("This should print")
LightPart.PointLight.Enabled = false
LightPart.Transparency = 1
FuelLelf = false
end
end
print(FuelLelf)
wait(1)
end
end)
(forgive my messy code writing) What's happening is, the code is working as intended mostly, but then it gets down to 0 and just stops, that would be good if the code also disabled the PointLigt, and made the LightPart transparent, but it does not. And stranger still, after 0 is printed the while loop continues to print true, I'm not sure what's happening, all I can think is the second if statement is not running, but I don't know why it would not run? Any help would be appriciated.
