generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Question about passing tables through remote functions

Previous Thread :: Next Thread 
Zylez is not online. 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
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
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 is not online. 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
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
11 Mar 2017 08:39 AM
meh..

I haven't studied all the global functions.
Report Abuse
Zylez is not online. Zylez
Joined: 26 Mar 2016
Total Posts: 417
11 Mar 2017 08:46 AM
b
Report Abuse
Zylez is not online. Zylez
Joined: 26 Mar 2016
Total Posts: 417
11 Mar 2017 08:55 AM
b1
Report Abuse
OzzyFin is not online. 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 is not online. Zylez
Joined: 26 Mar 2016
Total Posts: 417
11 Mar 2017 09:18 AM
@OzzyFin Ah, thank you!
Report Abuse
chimmihc is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image