Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Lua. Answers.
Re: Lua. Answers. [message #449492 is a reply to message #449480] Thu, 07 July 2011 00:12 Go to previous messageGo to previous message
snazy2000 is currently offline  snazy2000
Messages: 67
Registered: December 2007
Karma:
Recruit
local killedtimes = 0

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

Killed_Speccript = {}

function Killed_Speccript:Killed(ID, obj, killer) 
	print("Killed | ID - %d", ID) 
        if killedtimes == 0 then
	    InputConsole("spectate %d", ID)           
            killedtimes = 1
        else
            killedtimes = 0  
        end
end

Register_Script("Killed_Speccript", "", Killed_Speccript) 


Haven't done LUA in a long time but i think that should work Wink

[Updated on: Thu, 07 July 2011 00:30]

Report message to a moderator

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

Total time taken to generate the page: 0.00743 seconds