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

  Workspace.Union.Script:4: invalid argument #1 (Vector3 expected, got Instance) error in script?

Asked by
GOECWW 2
4 years ago

so ive got a error that said   Workspace.Union.Script:4: invalid argument #1 (Vector3 expected, got Instance) and idk how to fix it

here is the code:

while true do wait(0.3) for i = 1, 55, 1 do script.Parent.Position = script.Parent.Parent + Vector3.new(0.1,0.1,0.1) end end

0
Please use code formatting. Don't know how? It's very simple. 1. Select your code, 2. Press the blue "lua" button, 3. Your done! User#30567 0 — 4y
0
i noticed the bug when i posted this xd GOECWW 2 — 4y

1 answer

Log in to vote
3
Answered by
farrizbb 465 Moderation Voter
4 years ago
Edited 4 years ago

You did

script.Parent.Position = script.Parent.Parent + Vector3.new(0.1,0.1,0.1)

instead of

script.Parent.Position = script.Parent.Parent.Position + Vector3.new(0.1,0.1,0.1)

Errors like these are pretty self explanatory it's basically saying there needs to be a Vector3 in this line of code, but where the vector3 should be there was an instance, which is the Parent of script.Parent. There are different variations of this area like for example (number expected, got CFrame) so make sure you always make sure you're putting the right value in the right place.

Ad

Answer this question