Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I am trying to get the position of my Handle, but it is nil?

Asked by 6 years ago

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?

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. User#20279 0 — 6y
0
Could also be the CFrame why not just use Position? Lord_CthuIhu 2 — 6y

Answer this question