Recommended Posts

Hello dear users of this forum!

I'm a beginner in Lua and I don't how to start learning. I know some other languages. As JavaScript, Python, Pawno and etc. Can you help me with it? Which plugin create me for start? Thank you in advance and sorry for my English.

 

Share this post


Link to post

If you know JavaScript, then lua is just a little kid.

 

Start running some basic code at a demo for example:

https://www.lua.org/demo.html

 

 

JavaScript

The syntax is different, but the rules are almost the same.

 

The most confusing part in lua compared to JS might be the fact that:

  • `let` variables which are written down with the `local` key word.
  • Variables without declaration are available in every script (within the same resource). (also known as globals)
  • `const` and `var` variable types do not exist in lua.
  • There are document code blocks. (which in Javascript you need iffy's to do this.)
  • Arrays and objects do not exist in lua. But tables can be used as an array, object and both at the same time.
  • Tables used as arrays start at the index 1 instead of 0.

 

 

  • Like 1

Share this post


Link to post
1 hour ago, IIYAMA said:

If you know JavaScript, then lua is just a little kid.

 

Start running some basic code at a demo for example:

https://www.lua.org/demo.html

 

 

JavaScript

The syntax is different, but the rules are almost the same.

 

The most confusing part in lua compared to JS might be the fact that:

  • `let` variables which are written down with the `local` key word.
  • Variables without declaration are available in every script (within the same resource). (also known as globals)
  • `const` and `var` variable types do not exist in lua.
  • There are document code blocks. (which in Javascript you need iffy's to do this.)
  • Arrays and objects do not exist in lua. But tables can be used as an array, object and both at the same time.
  • Tables used as arrays start at the index 1 instead of 0.
I read a lot of stuff. But I can't understand it. How to do anything. Can you help me? 

Share this post


Link to post
23 minutes ago, Skream said:

you probably don't know any of those languages if you just couldn't follow something simple as what IIYAMA said. About LUA, there's a tutorial session here https://forum.mtasa.com/forum/123-tutorials/

I read all turtorials which IIYAMA send. I cant understand this :Oing lua. It's hard for me. I tried to create scripts, but they didn't work. There weren't any problems in debug.

23 minutes ago, Skream said:

you probably don't know any of those languages if you just couldn't follow something simple as what IIYAMA said. About LUA, there's a tutorial session here https://forum.mtasa.com/forum/123-tutorials/

And I know JS, Python. I know the bases of lua. But I can't create any script for my project. If you will send a material which I read, please, don't reply this post.

Edited by CleyzChan

Share this post


Link to post

@CleyzChan

How about you write the things in JavaScript, then I will explain you how to write those in Lua?

 

 

Share this post


Link to post
2 hours ago, IIYAMA said:

@CleyzChan

How about you write the things in JavaScript, then I will explain you how to write those in Lua?

 

 

Thank you. I already found a techer. Sorry to disturb. Sorry for my English)

Share this post


Link to post

I just watched one or two videos like "Lua in hour" and then looked through some source codes of resources and mta scripts, then tried to write what i needed.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.