WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 01 Mar 2015 06:42 AM |
server code function game.ReplicatedStorage.InfoGet.OnServerInvoke(client,battleNumber) print(battleNumber,getfenv()["Battle"..battleNumber]) return getfenv()["Battle"..battleNumber] end
It prints >(1, table: BLAH), so the getfenv() value DOES work
client code local info = game.ReplicatedStorage.InfoGet:InvokeServer(battleNumber)
error: keys must be strings
|
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 06:53 AM |
(1, table: BLAH) Is that a table inside of a table? That might not work but I know tables do |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 01 Mar 2015 06:55 AM |
the 1 is the battleNumber, the table part is just to confirm that IT is there is a table that exists on the server sided code
and yes, there is another table within the getfenv() table along with some other values |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 07:01 AM |
Sorry I didn't see the print statement before so idk what the parenthesis were from
function game.ReplicatedStorage.InfoGet.OnServerInvoke(client,battleNumber) for i,v in pairs(getfenv()["Battle"..battleNumber]) do print(i.." - "..type(v).." - "..tostring(v)) end
See what the table has |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 01 Mar 2015 07:06 AM |
the parenthesis is cuz im dumb
here is how the tables are set up
getfenv()["Battle"..ticket] = { [sender] = {["Opp"] = receiver,["Lead"] = nil,["Team"] = team(sender), ["Action"] = nil } [receiver] = {["Opp"] = sender,["Lead"] = nil, ["Team"] = team(receiver), ["Action"] = nil} }
the team function just returns a table |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 01 Mar 2015 07:06 AM |
| sender/receiver are PLAYER instances btw |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 07:10 AM |
getfenv()["Battle"..ticket] = { ["sender"] = {["Opp"] = receiver,["Lead"] = nil,["Team"] = team(sender), ["Action"] = nil } ["receiver"] = {["Opp"] = sender,["Lead"] = nil, ["Team"] = team(receiver), ["Action"] = nil} }
You'll have to do it this way which shouldn't be too much trouble |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
| |
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Mar 2015 07:43 AM |
Boop. Basically, it uses jsonEncode or some variety to send the table data. You can't use any object type (userdata) keys, nor can you use a mixture of the dictionary and array parts of the table. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 07:44 AM |
Did you add a comma in the table after sender?
This works for me
local value = { ["sender"] = {["Opp"] = workspace.BasePlate,["Lead"] = nil,["Team"] = {}, ["Action"] = nil }, ["receiver"] = {["Opp"] = workspace.BasePlate,["Lead"] = nil, ["Team"] = {}, ["Action"] = nil} } |
|
|
| Report Abuse |
|
|