Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
|
| 11 Mar 2017 08:30 AM |
| I've done a few experiments with passing tables from localscripts to remote functions that are then handled by server scripts. I passed two tables, one only containing key variables and another one containing key variables and key integers. It turns out whenever a key integer is in the table, all the other variables gets erased from the table. Can anyone explain to me why this is happening? |
|
|
| Report Abuse |
|
|
|
| 11 Mar 2017 08:34 AM |
You can use _G if the table is a global variable too.
--script
local tbl = { "Hi", "noo", }
--local script
function tbl:additem(itemname) _G.tbl[#_G.tbl+1] = itemname end
tbl:additem("...")
print(_G.tbl[3]) |
|
|
| Report Abuse |
|
|
Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
|
| 11 Mar 2017 08:35 AM |
| Global variables in server scripts cannot be accessed in localscripts. |
|
|
| Report Abuse |
|
|
|
| 11 Mar 2017 08:39 AM |
meh..
I haven't studied all the global functions. |
|
|
| Report Abuse |
|
|
Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
| |
|
Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
| |
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 11 Mar 2017 09:15 AM |
When a table with an array and a dictionary part is passed through a remote/bindable or saved to a datastore, the dictionary part is always cut out as mentioned in the wiki.
"A table passed with both an array part and dictionary part will lose the dictionary part of it, similar to saving tables in a datastore." |
|
|
| Report Abuse |
|
|
Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 11 Mar 2017 09:22 AM |
There isn't a technical reason for this.
Roblox is just lazy. The limit is of JSON. |
|
|
| Report Abuse |
|
|