Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] How do i know if a value is inbetween 2 other numbers?

Asked by 5 years ago
Edited 5 years ago

so i wanna know if a value is inbetween 2 other numbers for ex if 1 value is inbetween 4000 and 5000, how do i do that?

my attempt:

if script.Parent.Values.RPM.Value <= 5000 and script.Parent.Values.RPM.Value >= 4000 then
    print("f")
end
0
There doesn't seem to be anything wrong with this. Are you getting an error or does nothing print? Is script.Parent.Values.RPM.Value a valid pathway? zdragon100 0 — 5y
0
What exactly is RPM. If it's a stringValue the for loop won't be true. You're going to have to convert it to a number using tonumber(). royaltoe 5144 — 5y
0
its a numbervalue, yes its a valid pathway and im getting no error and no print jdm4llfem8 94 — 5y
0
ok i fixed it i didnt realize it but i didnt make it so it runs it when the value was changed thx for yall help yes jdm4llfem8 94 — 5y

Answer this question