iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 20 Jan 2016 12:18 PM |
| Example of wrapping an object such as humanoid ? |
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
| |
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
| |
|
|
| 21 Jan 2016 03:45 PM |
| I recommend against wrapping. It is inefficient, and they are pretty hard to make. If you learn metatables, then that's all you really need to know. They can make code quicker to do though. |
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 21 Jan 2016 03:46 PM |
| Then how would I use metatables ? |
|
|
| Report Abuse |
|
|
| |
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 21 Jan 2016 03:52 PM |
| Humanoid is a DataModel, I can't just attach a metatable to it and using one of it's function "newindex". Can you kinda give me a more in depth example ? |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2016 03:54 PM |
local Wrapped = setmetatable({kill = function(self) self.Health = 0 end}, {__index = Humanoid})
Wrapped:LoadAnimation(Blah) Wrapped.Health = 100 Wrapped:Kill() |
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
| |
|