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?
01 | function getComp(vector, comp) |
02 | return 1 |
03 | end |
04 |
05 | function split(part, pos, axis) |
06 | -- Test input |
07 |
08 | if (pos > getComp(part.size, axis)) then |
09 | print ( "pos too large" ) |
10 | end |
11 | 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:
1 | 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.