Page 1 of 1

Run a script automatically when the game starts?

Posted: Sat Sep 15, 2012 6:11 pm
by Starnice
To equip the team or delete a champion, etc.

I tried in init.lua, but it does not work.

An idea?

:?:

Re: Run a script automatically when the game starts?

Posted: Sat Sep 15, 2012 6:12 pm
by Magus
simply add a lua code without making it a function.
Or call itself for example:

Code: Select all

function exampleLua()
   print("This code runs once.")
end
exampleLua()

Re: Run a script automatically when the game starts?

Posted: Sat Sep 15, 2012 6:21 pm
by Starnice
Thank You!!! :o

Re: Run a script automatically when the game starts?

Posted: Sat Sep 15, 2012 11:30 pm
by Komag
does that need another "end" on it? (I'm not able to test it right now)

Re: Run a script automatically when the game starts?

Posted: Sun Sep 16, 2012 12:03 am
by Magus
end for what?
The exampleLua() just calls the function after the lua runs(basically after the map loads).

Re: Run a script automatically when the game starts?

Posted: Sun Sep 16, 2012 1:03 am
by Komag
I thought the code needed another "end" at the end, after exampleLua(), but it doesn't after all. I'm no programmer, I just copy, paste, and extrapolate a little here and there :)