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
 

how to function to be called like this stuff:dostuff(arg)

Previous Thread :: Next Thread 
vat21s is not online. vat21s
Joined: 07 Jun 2010
Total Posts: 2508
06 Apr 2015 03:37 AM
and get stuff as an argument too.
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
06 Apr 2015 03:40 AM
local stuff = {
a = function()
print(1)
end
}

stuff:a()


I script -~ chimmihc
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Apr 2015 03:40 AM
They are methods, when you do:
tbl:method(arg), it technically does the exact same thing as:
tbl.method(tbl, arg)

Meaning:
local tbl = {};
tbl.method = function(self, arg) print(arg); end;
tbl:method("Hello, world!");
tbl.method(tbl, "How are you world?");
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