i know the title is worded terribly, but i'm making a shift light for a car, and i set up a separate script to make it "flash" before it hits the optimal shifting point, but i want it to disable once the rpm value reaches a certain point
since i use "if rpm >= 8500 then script.Flash.Disabled = false"
then, i use "if rpm >= 9000 then script.Flash.Disabled = true"
but since the value is also over 8500, it enables the script, but also disables it at the same time is there a way to make it only turn on if its between 8500 and 9000? so then i can use the second if statement that i wrote down to disable it and have it stay disabled, so the light doesnt flash
any help is appreciated!
Try this maybe?
if (8500 <= rpm and rpm <= 9000) then -- Run your code here else -- Run your code here end
adding an and
to the arguments allows you to add them both to the same if statement. You could also add an 'or' in the same place for other usage. Hope this helps!
Try:
if rpm >= 8500 then script.Flash.Disabled = false elseif rpm >= 9000 then script.Flash.Disabled = true end
The elseif
block only executes if the first one doesn't pass