Re: Lua. Answers. [message #449480 is a reply to message #449472] |
Wed, 06 July 2011 16:55 |
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.
- Type/chat does not show up.
- Whenever we do type, we are sent to spectate and the second time we die and spawn. Happens regardless of what you type.
- 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
|
|
|