Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Another Lua question
Re: Another Lua question [message #449324 is a reply to message #449319] Fri, 01 July 2011 14:41 Go to previous messageGo to previous message
sla.ro(master) is currently offline  sla.ro(master)
Messages: 610
Registered: September 2010
Location: Romania
Karma:
Colonel
here is the fixed code, i saw some missing 'end'

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 players
        end
end

myscript = {}

function myscript:Killed(ID, obj, killer)
   -- called if someone get killed by someone else, not called if killed by null objects, like dying from falling.
	print("Killed", ID, obj, killer)
end

Register_Script("myscript", "", myscript) --register script 


this should work




Creator of Mutant Co-Op
Developer of LuaTT
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Level Edit Mayhem!
Next Topic: Shaders.dll Compiling Errors
Goto Forum:
  


Current Time: Sun Sep 01 16:19:32 MST 2024

Total time taken to generate the page: 0.00684 seconds