This lua code isn't working and I have no idea why

Here is the code which I have in my script: Script

Here is the output: Output

Am I being silly or should xCoord == wallInfo.x2 be true, since 16 does equal 16…?

Are they both number variable types? Try printing out type(xCoord), type(wallInfo.x2) to check

2 Likes

Yup! Here’s the revised code:
Script1

Output1

1 Like

I think this is due to floating point errors

Try to math.floor xCoord and wallInfo.x2