My goal is to insert two pieces of data to the table "Data" at the specified positions.
local Data = {
var.activeTime,
var.cooldown,
var.power,
var.leftCFrame,
var.rightCFrame,
var.isHoldable,
var.hasPowerbar
}
table.insert(Data, playerVariables.currentFoot, 2)
table.insert(Data, service.Player, 1)
However, this is the error:
invalid argument #2 to 'insert' (number expected, got string) -
When I purely put:
table.insert(Data, playerVariables.currentFoot)
table.insert(Data, service.Player)
the script works just fine but the data is in the wrong position (at the end)
*It may be useful to note that: playerVariables.currentFoot is a string. service.Player is the local player. *
The reason to why I have so many values in the table is that I am trying to organise my game in a very modular way, using tables to transport data through scripts.
Any help or other good practices are appreciated.
