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

if statement is not working and i am not getting an error message?

Asked by 3 years ago

i am trying to make a car

and the problem is that the if statement not working and i am not getting an error message

and if you wondering how i know that it is the if statement

the top speed value won't print or change

local TopSpeedValue = script.Parent
local MeasureTypeGet = TopSpeedValue.kind_of_speed
print(MeasureTypeGet.Value)
local KPHGet = TopSpeedValue.KPH.Value
local MPHGet = TopSpeedValue.MPH.Value
wait(30)
if MeasureTypeGet.Value == MPH then
    print(script.Parent.Value)
    script.Parent.Value = 138
end


2
MPH isn't defined, maybe you want to use MPHGet? Also, when that if statement is checked, the values MPHGet will be from when u defined it (30 seconds ago), not from when the if statement is ran. (In case you forgot about that) greatneil80 2647 — 3y
0
Replace MPH with MPHGet. because you never referenced MPH, but you did reference MPHGet. NGC4637 602 — 3y

Answer this question