Actually, you can declare and use variables the same (ok, similar) way you'd use them in any other programming language. Under
Advanced >> Variables you'll find two blocks, one for declaring/setting a variable and one for referencing (reading) it's value. Take a look at this useless example below:
This will set variable
test value to the value of
e (that's entity that is running the script's unique integer/number identifier). As it is a number, you can use your variable with all blocks from "Math" category, but you can also use it to form text like in this example (LUA will automatically cast it to string).
Despite the fact you can not change object texture at runtime from LUA at this point, the g_Entity variable is a LUA table (or array/object, as named in most other languages). And because each script accepts entity identifier
e, your code would most likely look like this:
ReplaceTexture(e, 'C:\Textures\blah')
But because earlier versions had possibility to have only two textures per object and only switch between them, it'll probably look like this:
At this point, I don't tend to encapsulate existing functions in my OOP framework, but instead I'm focusing on missing functions (like get distance between two entities in one line of code, get [nearest] entity/entities by name, etc....) so now it would look like this:
SetAltTexture(entity.e, 1)
As a someone who have already written code before, it might be easier for you to go and write some LUA in good old plain text editor. This tool is made for absolute beginners who have never written a line of code (or hundred) in their life. I personally never use this tool as I'm way faster in writing code (and I can use my OOP framework that simplifies everything alot).
But if you need anything else regarding this, don't hesitate to ask.