|
| 24 Aug 2017 10:24 PM |
when iterating through the table all the other items in it return properly, the function returns nil
Why is this?
The table is similar to this
thing = { "Name"; 5; 50; function()
end; } |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2017 10:25 PM |
This only happens online, might I add.
|
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
| |
|
|
| 24 Aug 2017 10:44 PM |
for i,v in pairs(thing) do print(i) print(v) end
when its supposed to print function it prints nil.
this is essentially what i'm doing.
I don't wanna post the whole script, because it's long, but the table 'thing' is within another table, and yes i'm properly iterating through both. its just odd that it prints every other thing except the function. |
|
|
| Report Abuse |
|
|
Ajastra
|
  |
| Joined: 01 Aug 2017 |
| Total Posts: 1461 |
|
|
| 24 Aug 2017 10:46 PM |
How is anyone supposed to help you if you don't post the relevant table?
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2017 10:51 PM |
| local EmptyProperties = {Empty=true} local EmptyEffects = {Empty=true} Skins = { Skin_OutrageousSword = { "Outrageous Sword"; ######### ### "An outrageous sword skin."; function() local Properties = {TextureId = ##################### = #### local Effects = EmptyEffects return Properties,Effects end; }; } |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2017 10:54 PM |
Skins = { Skin_OutrageousSword = { "Outrageous Sword"; 1; 1; "An outrageous sword skin."; function() local Properties = {TextureId = 1,Transparency = 0.5} local Effects = {Empty=true} return Properties,Effects end; }; } |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2017 11:12 PM |
this also might be a factor. The way im retrieving this table is a returned variable from a remotefunction
The remote function finds the table and returns it to the client. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 24 Aug 2017 11:15 PM |
"The remote function finds the table and returns it to the client."
And there is your problem.
You can't send functions across the client/server boundary. |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2017 11:26 PM |
| ugh thankyou. ill have to think of another way. if any of you know any, please dont hesitate. |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 25 Aug 2017 12:16 AM |
| why not have the function where you need it or run the function where you already have it and return the return value |
|
|
| Report Abuse |
|
|