game.Players.PlayerAdded:connect(function(player) local character = player.Character if character.Head.Position >= Vector3.new(0,0,-100) then local dostuffhere = dostuffhere end end)
That is my code so far, but I want the script to pay attention only to the Z position. I'll make it do stuff later. Thank you!
You can just use the Z property of Position
if character.Head.Position.Z >= -100 then
Just remember that these XYZ properties are read-only, so do NOT try to do this:
part.Position.Z = 50
That will just result in an error.