| |
|
|
| 09 Feb 2015 09:48 AM |
Yes?
I think eLunate did that with :Kill() method on a Player |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 09 Feb 2015 09:50 AM |
| Okay now I Need eLunate's wrapper. |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
| |
|
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 |
|
|
|
| 09 Feb 2015 09:56 AM |
| Alright, thanks I'll track this thread and get the wrapper when I get home. |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2015 12:21 PM |
Oh, I already took the wrapper a while ago.
"I like to program." - Bosswalrus |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 09 Feb 2015 12:33 PM |
Alright, thank you for all the advice.
"I like to program." - Bosswalrus |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2015 12:53 PM |
| What do you mean by method? |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2015 01:06 PM |
| A method is something like :Kick() |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|