local model = script.Parent
local available = true
function open()
if available == true then
for i = 0,2,0.1 do
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.new(-.25,0,0))
wait()
end
end
end
script.Parent.ClickDetector.MouseClick:connect(open)
if model.Main.Position >= Vector3.new(-244.769, 139.06, 51.98) then
print("part can't go any further!")
local available = false
end
I'm pretty sure the whole Vector3.new thing is wrong, but I'm not sure how to make the model not go any further once the PrimaryPart is or past a certain coordinate.

1 comment
You will need to compare each component of the Vector3 to it's corresponding one. You can also try calculating magnitude between the two parts if you don't have to use that specific point on line 13.