I am try to get the position of a handle of a tool, and i am getting this error,

    Workspace.CastSpellScript:10: attempt to index local 'pos' (a nil value)

And I don't know why, how can it be null?

Here is how I am trying to get the position, it is a local script inside a tool,

    local pos = script.Parent.Handle.CFrame.p

and I made the part was named Handle correctly. Why am I getting this error about that value being nil? It shouldn't be, right?

2 comments

0

Try removing the .p on the line of code. If that doesn’t help, it could be something else in the code that’s causing it.

0

Could also be the CFrame why not just use Position?