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 #449319 is a reply to message #449318] Fri, 01 July 2011 13:57 Go to previous messageGo to previous message
iRANian is currently offline  iRANian
Messages: 4307
Registered: April 2011
Karma:
General (4 Stars)
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.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Fri, 01 July 2011 13:59]

Report message to a moderator

 
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:21:51 MST 2024

Total time taken to generate the page: 0.00656 seconds