Pish85
(rip_Zephyr)
#1
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
happya_x
(Happya)
#3
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
Pish85
(rip_Zephyr)
#4
Tip #1 response:
Tip #2 response:
(literally the same error)
1 Like
happya_x
(Happya)
#5
.Position isnt calling a function so it cant have an invalid argument
something else is causing the error
1 Like
Pish85
(rip_Zephyr)
#6
It worked! Thank you! Now I need to fix 99 more bugs in my code!
1 Like
Rahh how did I not see that
1 Like
system
(system)
Closed
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.