|
| 19 Jun 2016 09:29 PM |
:SERVER: RemoteService['Manage Inventory'].OnServerEvent:connect(function(client,action,object) print(client,action,object) if action == 'Add' then AssetData:AddItem(client,object) elseif action == 'Get' then local Data = AssetData:GetInventory(client) print('Server Data:',Data) return Data end end)
:SERVER MODULE: local Inventory = { --[client] = {} --[game.Players.Player1] = {['Hat'] = 1} <-- An example of what it contains }
function lib:GetInventory(client) print('Inventory Accessed:',client) print(Inventory[client]) return Inventory[client] end
-->Inventory Accessed: Player1 -->table: 475883B0 -->Server Data: table: 475883B0
:CLIENT: local Data = RemoteService['Manage Inventory']:FireServer('Get',false) print('Inv:',Data)
-->Inv: nil
How can I fix this and pass the table? |
|
|
| Report Abuse |
|
|
| 19 Jun 2016 09:39 PM |
Try switching the remote event to a remote function (and then switch the calls and connectors to :ServerInvoke and .OnServerInvoke)
public static void main(String[] args) { System.out.println("Oops! Wrong language."); } |
|
|
| Report Abuse |
|
| |
|
| 19 Jun 2016 10:03 PM |
No problem :)
public static void main(String[] args) { System.out.println("Oops! Wrong language."); } |
|
|
| Report Abuse |
|