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 » Scripting Helpers
Home Search
 

Re: How can I detect when a method/function is exectued?

Previous Thread :: Next Thread 
1eggnog is not online. 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 is not online. 1eggnog
Joined: 08 Nov 2008
Total Posts: 7074
25 Mar 2012 08:13 PM
Bump.
Report Abuse
ServerLabs is not online. ServerLabs
Joined: 29 Dec 2010
Total Posts: 2263
25 Mar 2012 08:13 PM
:clone():connect() perhaps
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
25 Mar 2012 08:20 PM
You can't. Sadly, methods do not have events that trigger when they are executed.
Report Abuse
ServerLabs is not online. ServerLabs
Joined: 29 Dec 2010
Total Posts: 2263
25 Mar 2012 08:21 PM
Julien, I've seen it done before. I just can't remember exactly how.
Report Abuse
smurf279 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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