Problems
- You need to link an event or loop with these if statements
Your script only runs/triggers once when the game has loaded. If you link it with an event/loop, it'll check these if statements multiple times and achieve what you want.
- Don't check if decimal values are equal to each other (unless you know what you are doing)
Even if we linked this script up with an event, it will never run. Why? Because you are comparing decimal values of positions.
The position might say '1.000', but in reality it shows up as '1.000000001' or something similar along those lines. With that in mind, the script will never run because 1.000 doesn't equal 1.000000001.
How to improve what you are trying to achieve
Magnitude is the distance in studs between two vector points. If you want the player to be in a certain area to teleport them, check if they are in a magnitude of an area, then teleport them.
Rather than checking if they are in a certain Z position, use a part and apply a touched event to a part and teleport them accordingly
- Use greater than and less than
This will be more consistent than checking if it's equal as you are allowing for more tolerance for your if statements to trigger.
Hope this answers your question or gives you a better alternative!