Roblox Lua
More events.
local n=0
local m=Instance.new("Message",game.Workspace)
script.ChildAdded:connect(function(e)
wait()
local k
k=e.AncestryChanged:connect(function()
wait()
k:disconnect()
e.Parent=script
end)
m.Text="Hi! "..n
n=n+1
e.Parent=game.Workspace
end)
Instance.new("IntValue",script)
Creates an IntValue as a child of the current script and then uses events to endlessly move it back and forth between the script and the workspace while producing output via a Message instance.