1eggnog
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 7074 |
|
|
| 25 Mar 2012 08:11 PM |
For example, let's say I want to know when a part is cloned. How would I be able to detect when the :Clone() method occurs for that object?
Is this even possible? |
|
|
| Report Abuse |
|
|
1eggnog
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 7074 |
|
| |
|
|
| 25 Mar 2012 08:13 PM |
| :clone():connect() perhaps |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2012 08:20 PM |
| You can't. Sadly, methods do not have events that trigger when they are executed. |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2012 08:21 PM |
| Julien, I've seen it done before. I just can't remember exactly how. |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 25 Mar 2012 08:21 PM |
I'd give you my Improved Instance but I really just don't think thats necessary.
local part = Workspace.Base
local new_clone = function(obj) print(tostring(obj).." has been cloned") return part.clone(obj) end
local newBase = new_clone(part) newBase.Parent = game.Lighting
or better yet
new_clone(part).Parent game.Lighting |
|
|
| Report Abuse |
|
|