local position = script.Parent.Position.X
while wait() do
if position > 0 then
position = 0
end
end
This script which is supposed to limit the max x value of the frame that is the parent to 0, But instead it outputs the error attempt to compare number and userdata.
Any possible fix?

4 comments
Or you could use
My problem is how you do not provide sufficient amount of imformation to help you, which can result in a dislike. Please edit your question to let us know what "script.Parent" is (what is the script inside). Additionally, you need to add a description of exactly you want to accomplish. Only after that we can help you.
God, RBLX, you having a rough day?
Try removing .X from the variable declaration and reference it on line 4-5