Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My script returns the error: attempt to compare number and userdata. Any possible fix?

Asked by 4 years ago
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?

0
Or you could use AltNature 169 — 4y
0
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. RBLXNogin 187 — 4y
0
God, RBLX, you having a rough day? Ziffixture 6913 — 4y
0
Try removing .X from the variable declaration and reference it on line 4-5 Ziffixture 6913 — 4y

Answer this question