Lua Scream: Difference between revisions

From Spring
Jump to navigationJump to search
JK (talk | contribs)
Argh (talk | contribs)
m Font colors, 2 (used #55ee99)
Line 3: Line 3:
   ( ) -> nil
   ( ) -> nil


   <font color="darkgreen">This creates an userdata object, which calls a special
   <font color="#55ee99">This creates an userdata object, which calls a special
   user-defined function, when the object gets destroyed
   user-defined function, when the object gets destroyed
   (->garbage collector).
   (->garbage collector).

Revision as of 20:55, 27 October 2008

Scream UserData Object

Script.CreateScream

 ( ) -> nil
 This creates an userdata object, which calls a special
 user-defined function, when the object gets destroyed
 (->garbage collector).
 You use it like the follow:
 local myScream = Script.CreateScream()
 myScream.func  = function() Spring.Echo("AHHHHHH") end