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: Function in a table

Previous Thread :: Next Thread 
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
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
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Aug 2017 10:25 PM
This only happens online, might I add.

Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
24 Aug 2017 10:39 PM
Post your code.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
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 is not online. 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
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
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
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
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
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
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 is not online. 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
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
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 is not online. 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
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