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
 

Is there any way to make your own methods?

Previous Thread :: Next Thread 
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
09 Feb 2015 09:46 AM
Title says it all.
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
09 Feb 2015 09:48 AM
Yes?

I think eLunate did that with :Kill() method on a Player
Report Abuse
LucasLua is not online. LucasLua
Joined: 18 Jun 2008
Total Posts: 7386
09 Feb 2015 09:48 AM
With a wrapper yes.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Feb 2015 09:48 AM
function yourTable:YourMethod(...)

end

If you're talking about adding methods to existing userdata, then look in the examples inside my wrapper.
Report Abuse
Stefan631 is not online. Stefan631
Joined: 23 Dec 2010
Total Posts: 1350
09 Feb 2015 09:49 AM
Yes.

local brick = {
thing = 'Hello'
}

function brick:Change(v)
brick.thing = tostring(v);
end;

brick:Change('Goodbye');
print(brick.thing);
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
09 Feb 2015 09:50 AM
Okay now I Need eLunate's wrapper.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Feb 2015 09:50 AM
You mean, self.thing.

Using brick.thing would be stupid, since you could just use closures instead.
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
09 Feb 2015 09:52 AM
Thanks to you all.
Report Abuse
Stefan631 is not online. Stefan631
Joined: 23 Dec 2010
Total Posts: 1350
09 Feb 2015 09:53 AM
Sorry, yes.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Feb 2015 09:55 AM
http://www.roblox.com/item.aspx?id=211146719

There's the wrapper.
Just updated it to fix a lot of issues I'd overlooked originally, including the wrapped constructors sometimes not returning.
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
09 Feb 2015 09:56 AM
Alright, thanks I'll track this thread and get the wrapper when I get home.
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
09 Feb 2015 12:21 PM
Oh, I already took the wrapper a while ago.

"I like to program." - Bosswalrus
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Feb 2015 12:25 PM
Hehe. Well, I updated it anyway.
Also never a bad time to try and learn how it works.
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
09 Feb 2015 12:33 PM
Alright, thank you for all the advice.

"I like to program." - Bosswalrus
Report Abuse
warycapdecutie is not online. warycapdecutie
Joined: 13 Aug 2010
Total Posts: 14373
09 Feb 2015 12:53 PM
What do you mean by method?
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
09 Feb 2015 01:06 PM
A method is something like :Kick()
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
09 Feb 2015 01:09 PM
I am still planning to improve greatly upon eLunate's wrapper. :C

Oh well, I might get around to it sometime before July, otherwise I might forget it.
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
09 Feb 2015 01:10 PM
I'm still confused with my little module script, and why this debounce thing won't work.

"I like to program." - Bosswalrus
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