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
 

what do these brackets mean

Previous Thread :: Next Thread 
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
04 Aug 2015 02:49 PM
so i was looking in a script and i found this and i dont know what the brackets do

for i,v in pairs(script.Parent.Buttons:GetChildren())

local object = script.Parent.Purchases:FindFirstChild(v.Object.Value)
if object ~= nil then
objects[object.Name] = object:clone()
object:Destroy()

and some lines down,

objects[v.Object.Value].Parent = script.Parent.PurchasedObjects

so im confused what the brackets do

<3 cats <3
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Aug 2015 02:49 PM
Table indexing.
Report Abuse
LunaScripter is not online. LunaScripter
Joined: 27 Nov 2008
Total Posts: 813
04 Aug 2015 02:51 PM
() = adding arguments to a function
[] = table indexing
{} = table defining


- This is the will of Steins;Gate
Report Abuse
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
04 Aug 2015 02:51 PM
and what does that do exactly?


<3 cats <3
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
04 Aug 2015 02:51 PM
If you want to get an object in Workspace but it has spaces, you can do this

Workspace["Spaced Object"]

Or if you want to combine a variable with text/another variable and find that in Workspace

Workspace[variable1.." / "..variable2]

You can also use double brackets to create a string

str = [[ ayooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo ]]
Report Abuse
LunaScripter is not online. LunaScripter
Joined: 27 Nov 2008
Total Posts: 813
04 Aug 2015 02:53 PM
table{'a','b','c'}
print(table[2])

prints out 'b'

You can also index things using strings:

table{['Foo']='Yes',['Bar']='No'}
print(table['Bar'])

Prints out 'No'


- This is the will of Steins;Gate
Report Abuse
2JJ1 is not online. 2JJ1
Joined: 15 Mar 2012
Total Posts: 1571
04 Aug 2015 02:55 PM
You know how regular variables store only 1 thing?
var = "1 thing"
print(var)

Tables store several
var = {"here", " is", " several", " things"}
for i = 1,4 do
print(var[i])
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