• Trying to save entities in a table's current position
    2 replies, posted
I have a table of entities and I want to save their current position. I want to use this position to later compare it to see if the entity moved or not. However, I get the following error below: [ERROR] addons/bankingsystem/lua/autorun/server/sv_bankingsystem.lua:26: ambiguous syntax (function call x new statement) near '('   1. unknown - addons/bankingsystem/lua/autorun/server/sv_bankingsystem.lua:0 Here is the function: local function findItemsInBox(vCorner1, vCorner2) local tEntities = ents.FindInBox( vCorner1, vCorner2 ) local tItems = {} local iItems = 1 for i = 1, #tEntities do if (!table.HasValue(invalidItems,(tEntities[i]):GetClass())) then local pos = (tItems[iItems]):GetPos() tItems[iItems] = tEntities[i] (tItems[iItems]).position = Vector(pos.x, pos.y. pos.z) --print((tItems[iItems]).position) iItems = iItems + 1 end end return tItems end
Either add a semicolon after `items = ents[i]` or remove the parenthesis around 'items[item]`.
Thank you
Sorry, you need to Log In to post a reply to this thread.