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
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
| |
|
Protori
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
| |
|
Protori
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
| |
|
Protori
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
| |
|
Protori
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
|
| 09 Nov 2017 02:57 PM |
bump
www.youtube.com/protori |
|
|
| Report Abuse |
|
|
Protori
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
|
| 09 Nov 2017 03:03 PM |
bump2
www.youtube.com/protori |
|
|
| Report Abuse |
|
|
Protori
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
|
| 09 Nov 2017 03:05 PM |
bump3
www.youtube.com/protori |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
|
| 12 Nov 2017 10:28 AM |
bumpp
www.youtube.com/Protori |
|
|
| Report Abuse |
|
|
Protori
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
|
| 12 Nov 2017 10:47 AM |
bumpp2
www.youtube.com/Protori |
|
|
| Report Abuse |
|
|
Protori
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
|
| 12 Nov 2017 11:05 AM |
bumpp3
www.youtube.com/Protori |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 22 Feb 2014 |
| Total Posts: 253 |
|
|
| 12 Nov 2017 05:36 PM |
| ### ####################### |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 12 Nov 2017 05:42 PM |
| .. by not passing a mixed table? XD |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|