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

ERROR: attempt to perform arithmetic (add) on nil and Vector3?

Asked by 2 years ago
Edited by Xapelize 2 years ago
target.PrimaryPart=target.HumanoidRootPart
target:SetPrimaryPartCFrame(
CFrame.new(pos,pos+target.HumanoidRootPart.CFrame.lookVector))

What is wrong with these lines of code that would give me this error message? (the title)

0
By the way target is the player's character Matrixmaximus867 11 — 2y
0
Can you show the script T3_MasterGamer 2189 — 2y
0
because it’s hard to solve if you just show us one line. T3_MasterGamer 2189 — 2y

1 answer

Log in to vote
0
Answered by
Puppynniko 1059 Moderation Voter
2 years ago
Edited 2 years ago

the error says your trying to add nil to a vector3 and the vector3 is

target.HumanoidRootPart.CFrame.lookVector

so it means pos does not exist

Ad

Answer this question