If you know most of the commands, it is just two things you should know:
1) GG always repeat the script, so it runs the name_main function in a loop all the time until the entity die
2) Just speak it. It is just another language like english or french. If player pressed 'E' then print a string.
the code for this is:
if g_KeyPressE == 1 then
Prompt("Hi")
end
0 = No
1= Yes
So so the opposite is:
If player not press E then Print hi.
if g_KeyPressE ==0 then
Prompt("Hi")
end
at the end you must end your sentence with an "end". So you must do it with all your "sentences".
GG reads functions of the script so a script started with:
function nameofthescript_init()
-- A commentar is shown with -- in front of
end
function nameofthescript_main()
--Here you should place all you stuff you want to do in game
end
also there is a
function nameofthescript_exit()
end
which is activated if the entity dies, so most of the time it is used for AI
Maybe this helps you
PS: it is hard for all. Beginners who canĀ“t code have his problems, Advanced guys who can code different languages like c,c++,c#, java and so on have also their problems. You can not learn Lua in a week, it is a developing process. I learn myself always new stuff, which I never think about.
My dream is to develope games, which makes fun when I create it and fun when other people play it.