samosavo Posted June 24, 2016 Share Posted June 24, 2016 hello folks, as the title say i wanna learn lua So from where should i start ? i don't know anything about scripting Link to comment
0 Discord Moderators AlexTMjugador Posted June 24, 2016 Discord Moderators Share Posted June 24, 2016 Firstly, you should read a bit about Lua syntax and basic concepts: variables, data types, magic words, loops (for .. end loop, while .. do .. end loop and repeat .. until loop), functions, logical operators and tables. MTA Wiki has some interesting links for that in its main page, lua.org has a very complete (but not very newbie-friendly) manual and Google should yield useful results for you when looking for understandable advice. In addition, you can write Lua code and execute it online in lua.org, so you can practice while you learn easily. For your information, MTA uses Lua version 5.1. Once you know what Lua is about and how to write working algorithms, you are ready to start with MTA scripting. You should be able to understand almost everything that the wiki says, and it will be your best ally, really. I would say that 85% of scripting questions are already answered there, if you know where to look at and are proficient in English. Some articles are translated to other languages, but I would not recommend you to even think about looking at them. The majority of them are terribly outdated, and sometimes the translation is so incomplete or bad that it is even more confusing. I also find analyzing other people's resources quite useful: read the source code, and then try to understand what each line does. When you do that, you are automatically revising and applying scripting concepts, you can track what you can't understand yet to learn it, you are viewing examples of how to solve scripting problems and you open your mind to different coding styles. Besides analyzing, you can also modify the resource to suit your expectations (but keep in mind that if you publish it on the Internet and claim that it is your own code it will likely be bad for you). You might be wondering: what kind of resources can I pick to learn? I would suggest you simple (no more than 500 lines per script file and not using advanced concepts like metatables) but powerful resources, which are both client and server side, so you can see how does the server interact with the client and viceversa. The gameplay (not gamemode!) resources bundled with the MTA: SA server are a good starting point. Nevertheless, if the wiki, Google, Stack Overflow, Lua Users and other people's code are not enough to solve your problems, you can ask for help in the scripting subforum, or join us on IRC to chat about it. Link to comment
Question
samosavo
hello folks,
as the title say i wanna learn lua
So from where should i start ?
i don't know anything about scripting
Link to comment
1 answer to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now