something like:
function OnObjectCreate(o) --whenever an object is created
if Is_A_Star(o) then --check if they're a real player
Attach_Script_Once(o, "myscript", "")
--attach myscript to them if they are
myscript = {}
function myscript:Killed(ID, obj, killer)--this function gets called whenever something this script is attached to is killed
print("Killed", ID, obj, killer)
end
Register_Script("myscript", "", myscript)--register our script with the engine
I don't really know how LUA works and how the LUA plugin works though. I think the print() call in myscript::Killed() is incorrect (what do you want to make it do?), take a look at http://icculus.org/~theoddone33/lua/ for a tutorial on it.
[Updated on: Fri, 01 July 2011 13:59]
Report message to a moderator