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

attempt to call global 'Vector3' (a table value) error. What is causing it?

Asked by 6 years ago

Haven't used the site in a while, and haven't been scripting for a while either. I have this script here that changes the position of a part every 2 seconds. It is in a local script, in StarterPlayerScripts. But the error is attempt to call a table value, but I don't understand it. It happens on line 2.

while true do
  workspace.MovingPart.Position = Vector3(15, 15, 15)
  wait(2)
  workspace.MovingPart.Position = Vector3(0, 0.5, 0)
  wait(2)
end
0
Any help is appreciated User#23407 5 — 6y
0
ERM it is supposed to be in a script in workspace or in serverscriptservice DEVLogos 8 — 5y

2 answers

Log in to vote
2
Answered by 6 years ago

been waiting forever for a question but the fix is just do vector3.new(numbers)

0
Thank you! This worked, I'm so stupid. I appreciate the help. I gave an upvote. User#23407 5 — 6y
Ad
Log in to vote
0
Answered by
tacotown2 119
6 years ago
while wait do -- makes a loop
wait() 
game.workspace.MovingPart.Position = Vector3.new(15, 15, 15) -- u had to add Vector3.new bcz if u just do vector3 it will think its a table wish it isnt srry im bad at explaining lol
wait(2) -- wait 2 seconds
game.workspace.MovingPart.Position = Vector3.new(15, 15, 15)
wait(2)
end
0
you should keep it as "while true do" and try not to add useless comments such as "wait 2 seconds", not trying to be rude just trying to improve your answer. Aznarog 54 — 6y

Answer this question