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: nil in table

Previous Thread :: Next Thread 
Valenthian is not online. Valenthian
Joined: 01 Oct 2013
Total Posts: 590
27 Sep 2016 12:32 PM
Lets say I have a table {'a','b',nil,'d'}

How do I pick out the nil in the table but keep the same order?
Report Abuse
batistapowerbonbtla is not online. batistapowerbonbtla
Joined: 16 Dec 2011
Total Posts: 2203
27 Sep 2016 12:46 PM
nil can't exist in a table

https://www.roblox.com/library/322704057/Hillary-Clinton
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
27 Sep 2016 01:01 PM
If it's nil, it doesn't exist.


Report Abuse
Valenthian is not online. Valenthian
Joined: 01 Oct 2013
Total Posts: 590
27 Sep 2016 01:47 PM
It can because when I unpack the table it says this:

English nil Sports Science Geography

So my question again, how do I get rid of of the nil inside an ARRAY then
Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
27 Sep 2016 01:51 PM
You.. shouldn't be letting nils get into your tables at all?


Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
27 Sep 2016 02:13 PM
that is very strange, apparently you can get a nil value in a table if you set it up with nil being between actual values

heres a protip, dont set up your tables with nil in them
Report Abuse
Valenthian is not online. Valenthian
Joined: 01 Oct 2013
Total Posts: 590
27 Sep 2016 02:14 PM
This generates the nil, I just cannot find out why. function #################### ##### is a number from 1-4, function called i = 1,4 do local New = {} local R = Pos for i,v in pairs (Table) do if R + 1 > #Table then R = 1 elseif R + 1 <= #Table then R = R + 1 end table.insert(New,R,v) end local Fixed = {} -- trying to fix the nil part here, did not work for local Deduct = 0 for i,v in pairs (New) do if v ~= nil then table.insert(Fixed,i - Deduct,v) else Deduct = Deduct + 1 end end return Fixed end
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