Hi, I've read a few tutorials on Roblox and Lua and I'm becoming a bit seasoned in the language. But I still need to improve
Anyways, I was looking over the classic "Pokeball" script used in the popular "Pokeball" free model on roblox, and I noticed that the Event handler was assigned to a variable.
connection = Ball.Touched:connect(onTouch)
Even more so, the variable was connected to another method, "disconnect"
...
function onTouch(hit)
connection:disconnect()
...
Funny thing is, this "disconnect" method is marked as obsolete on the roblox wiki (http://wiki.roblox.com/index.php?title=RBXScriptSignal#Methods), yet the model still runs.
So my main questions are,
How can use a variable to store an event handler? -Should the function still run as marked?
What ways can this variable be used?
also
Why is this obsolete :disconnect() method working and should I replace it (if so, how)?
