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 » Scripting Helpers
Home Search
 

Re: Help! Reading from Table

Previous Thread :: Next Thread 
CTServant001 is not online. CTServant001
Joined: 01 Feb 2013
Total Posts: 211
12 Apr 2014 08:52 AM
for i=1,#items do
local n1 = items[i].Name
if (p.Name == (n1 .. " Node")) then
print('found')
end
end

_____________________________
No errors, the problem is with how I am trying to get the name
n1 reads from a table, and it takes 1 of those items at a time.
I am trying to check the name in the table, and add a word to the name. After all that, I check it with the name of the object in workspace.

My formatting for getting the name out of the table is off, and I need help getting it.
Report Abuse
CTServant001 is not online. CTServant001
Joined: 01 Feb 2013
Total Posts: 211
12 Apr 2014 09:14 AM
Help?
Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
12 Apr 2014 09:15 AM
Items in the table have to be instances for this to work. If you're trying to get objects checked from workspace change items to Workspace:GetChildren()

for i,v in pairs(items) do
if v.Name == v.." Node" then
print'found'
end
end
Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
12 Apr 2014 09:16 AM
wait, why would you have if (p.Name == (n1 .. " Node")) then if n1 already has node on the end?
you're asking this
n1 = "something Node"
if (p.Name == ("something Node" .. " Node")) then
Report Abuse
CTServant001 is not online. CTServant001
Joined: 01 Feb 2013
Total Posts: 211
12 Apr 2014 09:21 AM
I'm getting items from a config file in Replicated storage. Adding it to a table. Then i am checking everything in the table with what is in Workspace for an item that has same name (with appending the " Node").
Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
12 Apr 2014 09:26 AM
for i,v in pairs(items) do
for x,y in pairs(Workspace:GetChildren()) do
if v.Name.." Node" == y.Name then
print'found'
end
end
end
Report Abuse
CTServant001 is not online. CTServant001
Joined: 01 Feb 2013
Total Posts: 211
12 Apr 2014 09:29 AM
thanks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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