A question about teleporting a part if the X cordinate goes over a specific number!

Hello everyone!

I have a bit of a problem… Im trying to get a Model to teleport automatically when its PrimaryPart X-Coordinate goes over a specific number! I tried to use a while loop but that didnt really work! I hope you can help me… Thanks!

local Model = script.Parent.Noob


while true do
	
	wait(1)
	if Model.PrimaryPart.Position.X >= 67 then
		Model:MoveTo(Vector3.new(65.65, -0.45, 11.732))
		print("Yes")
	else
		print("No")
	end

end

After testing around i tought you could have some ideas!

Use GetPropertyChangedSignal("Position") then do a check on the X value if Model.PrimaryPart.Position.X >= 67 then.

I recommend using CFrame, for positioning, however.

1 Like

wow that actually worked lol! Thanks :grinning: