Why is this script erroring? (Vector3 expected, got nil)
Here is the script:
2 | local vCharacter = Tool.Parent |
3 | local vPlayer = game.Players:playerFromCharacter(vCharacter) |
4 | local shield = Instance.new( "Part" ) |
5 | local spawnPos = vCharacter.PrimaryPart.Position |
6 | spawnPos = spawnPos + (v) |
9 | shield.Position = spawnpos |
When I click with the tool in play solo, I get this error:
bad argument #3 to 'Position' (Vector3 expected, got nil)
I can't work out what is causing this, because I have used the same piece of code in other tools and it has worked