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
 

printing the contents of a table

Previous Thread :: Next Thread 
U_7 is not online. U_7
Joined: 30 Dec 2014
Total Posts: 21
05 Mar 2016 02:35 AM
how do i print the contents of a table?
thanks in advance.



Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
05 Mar 2016 02:36 AM
for i, v in pairs (Table) do print(v) end



Report Abuse
U_7 is not online. U_7
Joined: 30 Dec 2014
Total Posts: 21
05 Mar 2016 02:37 AM
no.. like lets say a remote event prints a table, and the table changes every second, how do i print the table that the remote event prints?


Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
05 Mar 2016 02:41 AM
remoteEvent.OnServerEvent:connect(function(...) --Or something
local Table = {...}
for i, v in pairs (Table) do print(i) end
end)

^ something like this.



Report Abuse
U_7 is not online. U_7
Joined: 30 Dec 2014
Total Posts: 21
05 Mar 2016 11:04 AM
bump, can anyone offer help with this?


Report Abuse
checkplate is not online. checkplate
Joined: 05 Jan 2016
Total Posts: 1379
05 Mar 2016 11:05 AM
function tprint (tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
tprint(v, indent+1)
else
print(formatting .. v)
end
end
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