function newpos(xScale, xOffset, yScale, yOFfset) print(f.Position) end local f = {} f.Position = 1 f.Size = newpos(1, 0, 1, 0) f.Filled = true f.Visible = true
how do i get the f table from newpos?
how do i get the f table from newpos
If you want to get a table from a function that function needs to return that table.
Let's say you want to create a table that represents a 2d point:
function newpos(x, y) local p = { x = x, y = y, } return p end
Then you can do something like
local origin = newpos(0, 0) print(origin.x, origin.y)
If you want to get a table from a function that function needs to return that table.
Let's say you want to create a table that represents a 2d point:
Then you can do something like