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: What's wrong with this table?

Previous Thread :: Next Thread 
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
07 Nov 2017 04:18 PM
The table doesn't return nil, but everything inside does. :/
Trust me, the table isn't nil, I don't have any errors outside of this, nothing else is wrong. I'm using "in pairs" in a local script outside of this and everything is returning nil.

local function inventoryRequested(code)
if code == 'Cjc8udMec1' then

local inv = {

Loadouts = {

Garry = {
Weapon = 'Stock',
Cosmetic1 = nil,
Cosmetic2 = nil,
Outfit = nil,
Ammount = 1,

},--Garry

Ivy = {
Weapon = 'Stock',
Cosmetic1 = nil,
Cosmetic2 = nil,
Outfit = nil,
Ammount = 1,


},--Ivy

Trainer = {
Weapon = 'Stock',
Cosmetic1 = nil,
Cosmetic2 = nil,
Outfit = nil,
Ammount = 1,

},--Trainer

}, --Loadouts

Cosmetics = {

PremiumHat = {
Quality = {
q1## #C######### q2 = "None",
}, -- Rarity, and what effect it has if mythical.
indexPos = {category = 'Cosmetics',iName = 'PremiumHat'},
Ammount = 1,
Archivable = false, -- can't trade, sell, or craft ( added later )
}, -- Hat you get for becoming premium, given because the player has bought early access ( will be removed later )

},

Taunts = {

FakeDeath = {
indexPos = {category = 'Taunts',iName = 'FakeDeath'},
Ammount = 1,
Archivable = false,

},

},

Potions = {

FlamePotion = {

indexPos = {category = 'Potions',iName = 'FlamePotion'},
Amount = 1,
Archivable = false,

},

},

Equipment = {

EnergyDrink = {

indexPos = {category = 'Equipment',iName = 'FlamePotion'},
Amount = 1,
Archivable = false,

},

},

Other = {

},

}--Inventory

return inv

end
end

requestInv.OnServerInvoke = inventoryRequested


www.youtube.com/protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
07 Nov 2017 04:21 PM
b


www.youtube.com/protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
08 Nov 2017 04:27 PM
b2


www.youtube.com/protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
08 Nov 2017 04:34 PM
b3


www.youtube.com/protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
08 Nov 2017 04:43 PM
b4


www.youtube.com/protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
08 Nov 2017 04:50 PM
b5


www.youtube.com/protori
Report Abuse
Y0_dude is not online. Y0_dude
Joined: 03 Aug 2016
Total Posts: 113
08 Nov 2017 04:53 PM
Just a shot in the dark but if the function is returning nil, then maybe the code (parameter in the function) is wrong? By the way you shouldn't use a code ######## in the hopes of stopping an exploiter.
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
09 Nov 2017 09:12 AM
nope, I commented out the code, didn't work


www.youtube.com/protori
Report Abuse
TaaRt is online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
09 Nov 2017 10:06 AM
The first argument when a client is calling the server is a player, yours seems to be code thus the if-statement yields false and the function returns nil
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
09 Nov 2017 02:43 PM
dude, I erased the "code" portion, and i already told you that

still nothing


www.youtube.com/protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
09 Nov 2017 02:57 PM
bump


www.youtube.com/protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
09 Nov 2017 03:03 PM
bump2


www.youtube.com/protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
09 Nov 2017 03:05 PM
bump3


www.youtube.com/protori
Report Abuse
soutenu is online. soutenu
Joined: 09 Dec 2011
Total Posts: 1021
09 Nov 2017 03:34 PM
the first parameter passed to the function is the player who fired the event
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
12 Nov 2017 09:19 AM
I told you I completely removed the parameters.


www.youtube.com/Protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
12 Nov 2017 10:28 AM
bumpp


www.youtube.com/Protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
12 Nov 2017 10:47 AM
bumpp2


www.youtube.com/Protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
12 Nov 2017 11:05 AM
bumpp3


www.youtube.com/Protori
Report Abuse
Lightning_Dev is not online. Lightning_Dev
Joined: 24 Feb 2016
Total Posts: 380
12 Nov 2017 11:14 AM
It clearly says that you cannot pass mixed tables through remote events/functions on the wiki.

http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions#Mixed_Tables

"If a table is passed with mixed indices (some values indexed by number, others by string), then only the data indexed by number will be passed. If the table does not have mixed indices, then no data will be lost."
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
12 Nov 2017 02:55 PM
Then how should I return a table or get a new inventory?


www.youtube.com/Protori
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
12 Nov 2017 05:36 PM
### #######################
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
12 Nov 2017 05:42 PM
.. by not passing a mixed table? XD
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
12 Nov 2017 07:20 PM
then is there another way I should do it?


www.youtube.com/Protori
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
12 Nov 2017 07:27 PM
Yes, the only other way.
Not passing a mixed table.. 😅
Report Abuse
Y0_dude is not online. Y0_dude
Joined: 03 Aug 2016
Total Posts: 113
12 Nov 2017 07:44 PM
From what I can see, the mixed table is not you problem. All of you indices are strings so I don't know why the inventory wouldn't contain a value.


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