I printed both of the values to make sure that they were both equal to 16, and then on the next line I am checking to see whether they are equal or not. This was the output:
For some reason, even though the two values are 16 it still returns false?? Can somebody please help thank you.
It could be possible that both of the variables could be referenced as different Value Types, are you sure that you’re equaling them to the same “Number” value? And not a string?
You can use == which compares if two things are equal. You can’t use just = because that tries to set a value and that doesn’t work when you call functions and things.
@OP What is the ClassName of the Space value? Is it a StringValue? If so, the value will be a string, and you have to convert its Value to a number when you compare. You can do that with tonumber:
tonumber(player:WaitForChild("Space").Value)
Also, just a quick little tip so you don’t need to type as much, you can give multiple things to the print function and it will add a space between each:
print(num, tonumber(player:WaitForChild("Space").Value)) -- Would print "16 16"
This also can do some special things, for example, with the new output it can show you tables (and you can’t do that if you make the table a string)