Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I get a specific coordinate position of a brick? (i.e. Get the Z position specifically.)

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!

1 answer

✓ Accepted answer

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.

1 comment

0

Thank you, this saves me a lot of trouble!

This discussion is preserved as it was. New answers, comments, and votes are closed.