Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Lua. Answers.
Re: Lua. Answers. [message #449480 is a reply to message #449472] Wed, 06 July 2011 16:55 Go to previous messageGo to previous message
hego64 is currently offline  hego64
Messages: 19
Registered: April 2011
Location: Hegoville
Karma:
Recruit
Thanks! I was able to make the spectate work now. But I have one more problem...

This is what I currently have in LUA.

function OnObjectCreate(o) 
	if Is_A_Star(o) then 
		Attach_Script_Once(o, "myscript", ""
              
    end
end

myscript = {}

function myscript:Killed(ID, obj, killer) 
	print("Killed", ID, obj, killer)
end

	if KpID ~= -1 then
	InputConsole("spectate %d", pID)

Register_Script("myscript", "", myscript) 
	
end


I do not know what is wrong with this. But when I try it in-game, this is what happens.



  1. Type/chat does not show up.
  2. Whenever we do type, we are sent to spectate and the second time we die and spawn. Happens regardless of what you type.
  3. I still get an FDS error saying I can't have more than one script named myscript. I do not know why this happens, because I have checked and I have only ONE myscript function with that. What can I do to rename this or something to fix it? I really need the chat fixed too.


I don't know what else to do...can anyone help me to figure out what I did wrong in this?

Thanks,
-Hego64


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Looking for some mappers for campaign mode...
Next Topic: Lua sleep()
Goto Forum:
  


Current Time: Fri Dec 20 12:57:24 MST 2024

Total time taken to generate the page: 0.00815 seconds