I'm trying to compare a number (pos) with another number (returned by getComp()). I get this error: Workspace.Part.Script:28: attempt to compare number with function. Line 28 is the one with > . What am I doing wrong?
function getComp(vector, comp) return 1 end function split(part, pos, axis) -- Test input if (pos > getComp(part.size, axis)) then print("pos too large") end end
I'm not actually getting any errors using your function, copied, with tests of split(Instance.new("Part"), 1, 1) and split(Instance.new("Part"), 10, 1)
Copy the full script?
I figured it out. I was calling split() like this:
split(part, split, axis)
The problem was i used the same name for a variable and a function (split). I changed it and now I'm getting some other wierd error: startScript re-entrancy has exceeded 3 . Probably an unrelated issue though.