Well, this one will work as long as there are no variables with the same name and no hooks which handle the same event and have the same name.
So if you load these two scripts:
script 1:
function test() echo("test") end
add_hook("draw2d", "", function() set_color(0,0,0,1) draw_text("test",50,50) end )
scipt2:
test = "haha"
add_hook("draw2d", "", function() set_color(0,0,0,1) draw_text("test2",100,100) end )
that won't crash but only the 2. script will work since it overwrites the first.
But if you change script 2 to:
teststring = "haha"
add_hook("draw2d", "asdf", function() set_color(0,0,0,1) draw_text("test2",100,100) end )
everything will be fine.
All you have to do is add your script names to the array in my script.
You can even use all the (non-local) stuff of script 1 in script 2.
Last edited by psycore; Jul 19, 2011 at 09:59 PM.