I'm making a sliding door that is supposed to print("test") if newVal == 60 but for some reason it doesn't, although it does print("ran", newVal) could someone please tell me why it doesn't detect if newVal == 60 ? Here is the script (It is a server script inside of a part which is located in workspace):
local valueObj = game:WaitForChild("ServerStorage").ElevatorValues.Easy.Intermission
valueObj.Changed:Connect(function(newVal)
if newVal == 60 then
print("test")
for i=1, 100 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0.1, 0)
wait()
end
elseif newVal == 10 then
for i=1, 100 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, -0.1, 0)
wait()
end
end
print("ran", newVal)
end)
If you have any idea why this isn't working please help!

7 comments
You say it does print "ran", newVal. What number does it print when it prints that? Is it 60? If it is 60 then is it actually a StringValue, making the 60 a string and not a number?
I have a different script that makes the intermission value start at 65 then changes it by -1 each second but that works fine
What class is valueObj, and what is line 16 actually printing?
My question is what is newVal printing? Based on the code, if the newVal == 10 line is running (thus giving the read-out) then there must be something wrong with your newVal so that the number 60 is never expressed.
I have a script that changes the value to 65 then changes by -1 each second and the print("ran", newVal) prints ran 65 then ran 64, ran 63, ran 62, ran 61, ran 60, ran 59 and so on until it gets to 0 and stops
1waffle1 your first comment fixed it, I just changed the number 60 to "60" and it worked
also I changed 10 to "10"