Why is Vector3 requiring a string? (PLZ HELP)

I’ll try to make this as quick as possible. I’m trying to convert a model’s Pivot into a Vector3. Here’s my code:

local newRigPos = Vector3.new(rigPivot[1], rigPivot[2], rigPivot[3])
-- newRigPos is equal to the item's Pivot --

However, I get this error:


I do not know why it’s asking for a string instead of a number. Can someone plz help?

2 Likes

Um that’s a crazy error. Try these troubleshooting tips?

  • Make sure rigPivot is an array of numbers
  • Try converting each element of the array to a number with tonumber() like this:
local x = tonumber(rigPivot[1])
local y = tonumber(rigPivot[2])
local z = tonumber(rigPivot[3])

local newRigPos = Vector3.new(x, y, z)
2 Likes

this does the same thing
also vector should never want a string input so i think its the wrong line

local example = model:GetPivot()
local pivotPosition = example.Position
1 Like

Tip #1 response:

Tip #2 response:

(literally the same error)

1 Like

.Position isnt calling a function so it cant have an invalid argument

something else is causing the error

1 Like

It worked! Thank you! Now I need to fix 99 more bugs in my code! :slight_smile:

1 Like

Rahh how did I not see that :stuck_out_tongue:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.