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

Attemp to call from table value?

Asked by 2 years ago
Edited 2 years ago
while true do
        wait(3)
        local Bricks = Instance.new("Part",game.Workspace)
    Bricks.Anchored = false
    Bricks.Position = Vector3(0,20,0)
end

Im trying to learn Lua and i tried making random parts fall out of the sky but it does not work :C

1 answer

Log in to vote
0
Answered by
Pupppy44 671 Moderation Voter
2 years ago
Edited 2 years ago
Bricks.Position = Vector3(0,20,0)

In this line (5), you are trying to call Vector3 as a function. This wont work because Vector3 isn't a function/constructor, but rather a data type/table. Therefore, you won't be able to call Vector3 itself.

In other words, to correctly create a Vector3 object, you will need to use the new constructor inside it.

Bricks.Position = Vector3.new(0,20,0)
Ad

Answer this question