Attempt to call a table value?

Hey guys! So basically, I am checking if the size of a player’s head is normal sized, if it is, then it will carry on with the code. One issue though is that whenever I put my script in, it gives me an error “Attempt to call a table value” which is strange because that’s kind of what I’m trying to do, and I don’t know why it would throw an error for that. Can you not see if a value is equal to a table when using if? Here’s the code that’s causing my issue:

if player.Character.Head.Mesh.Scale == Vector3(1.25, 1.25, 1.25) then

This issue occurs if I used either UDim2() and Vector3()

21 Likes

Vector3 itself cannot be called. You need to call it’s constructor function new:

Vector3.new(1.25, 1.25, 1.25)

Vector3 documentation shows this and other methods available.

Along with this, you might benefit from the FuzzyEq method. If you find that your exact matching isn’t working, it might be due to floating-point inaccuracies. If that happens, try this instead:

if player.Character.Head.Mesh.Scale:FuzzyEq(Vector3.new(1.25, 1.25, 1.25)) then
35 Likes

Oh my bad, that was a very simple mistake to make. I had always assumed that .new is only if you are creating a new point or instance within Vector3.

10 Likes