Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Any tips on how to understand and learn code? What resources did you use to learn?

Asked by 8 years ago

Code is an Alien language to me, as an English speaker who taught himself German, I still can't get my head around learning this language. Please link me any websites you used or give me any tips you used to understand code better.

0
We have a blog post about this. User#11440 120 — 8y
0
I mostly taught myself through trial and error. But YouTube tutorials are a really big help, try looking at PeasFactory's tutorials :) xXLegendarySoldierXx 129 — 8y
0
Computers havent got so advanced yet, to understand humans. There is alot of ways to say "hi". Although, scripting may not be easy, it is not a imaginary language. Some of it makes sense, like if statements. SH_Helper 61 — 8y

5 answers

Log in to vote
3
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
8 years ago

Your problem is that Lua, like any programming language, is not meant for humans to talk to each other in. It is meant for humans to tell computers how to do things.

The best tip I can give you before starting to do any kind of development with Lua is to experiment with it and figure out how it works, using a standalone interpreter.

The online PIL book is a good resource, although academic in nature. RBX.Lua is based on Lua 5.1 if that is what you want to pursue.

This reference will be your best friend for a while.

Ad
Log in to vote
0
Answered by 8 years ago

Read the roblox wiki scripting tutorials for likes 3 hours each day.

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

Everyone has given you some very helpful resources. If I can tell you one thing to help you; don't rush it. You will get frustrated when you keep getting an error. Take your time. Before you move on to the next thing, make sure you understand the first thing. Knowing that, start with the basics. Also, don't be afraid to look in the models section and take a look at what other people have done. Don't use their scripts but use it as guidance if you can't understand something.

Best regards in learning to script.

Log in to vote
0
Answered by 8 years ago

Syntax

Code is just language. It's just a finicky logic-based language designed for computers instead of people. Code still (technically) has nouns, verbs, adjectives, and some of the cases you might be familiar with. The trick is however to not think of it like a normal language. If you are ready to see it as a logical (And mathematical) language, try this.


If you're not ready to treat it as a mathematical language, try thinking of it as a normal language but differently. This approach is not suitable in the long run, but it may help you grasp the general concepts.

Consider a language where you use some predefined words to make all of the other words that you want. Say you want a colour, and you want to call it red. In Roblox's Lua, that looks a bit like

red = Color3.new(1,0,0)

Which says "I want a word called red, and it's going to be a new Color3 value. You don't have to worry about what happened with the Color3 right now, or how it makes the colour red, because we're just dealing with making your words. The Color3 you can consider as a noun, or an adjective. Take your pick for whichever makes sense at the time, because there's no real good way to decide with these things - This is where they differ, because Color3 is a value, which has properties, and describes itself. But it can also be used to describe something else. A way to think of it is to consider everything as special new types of words which can be treated as adverbs, verbs, nouns and adjectives, depending on what they describe.

new is a function, which is for all intents and purposes a verb. By using () you are calling the new function which means you are telling it to happen. Now. At that point in your script (Which you can also consider as being a story, if you like).

The 1, 0, 0 in the parentheses (The ()) are arguments, which you may also hear being called parameters, which are like adverbs and tell the function how to work. Just like verbs.

At this point, it is super important that you look at the mathematical part of code because honestly you're not going to be able to write any code like this. Things get even more confusing: x.y in Color3.new means y of x, as in the genitive case. y in this case is new, which is a member of x (Color3). If you see a function (verb) with : at the front, for example Part:Destroy(), it means the function is a method, which is a reflexive verb. Which means do Destroy to Part. You can combine these with arguments just as with other functions.


It doesn't make sense!
Trying to think of it as a normal language leaves it really unlikely to make sense, and it certainly doesn't make sense just as other things should; it leaves out operators and complex operations, including simply manipulating values, but it should help you understand the language if it is used alongside the mathematical/logical interpretation (Learning to program)

But how do I make (x)?
You just have to learn. Giving up won't teach you anything, and learning by example will not teach you the language. Other people may beg to differ, but they normally aren't any good at programming either.

I'm really bad at maths.
You might be out of luck. If you're like me and you're only bad with numbers, you'll be fine, but if you struggle with understanding the logical processes and instructions for maths (eg BIDMAS/BODMAS, algebra, graphs and functions, venn diagrams) then you may unfortunately be amongst the people who just can't grasp logic-based operations with ease. It doesn't mean you can't learn to code, but it does mean you will struggle.

If in doubt, learn it as a mathematical process. It's much easier when you learn it how it is.
Log in to vote
-1
Answered by 8 years ago

I know, adark probably has the best advice, but if your in to video tutorials (like me) try Peaspod's series, he has beginner - advanced tutorials that are pretty good, and gave me a great understanding in basics for lua.

He also makes tutorials for leaderboards, guis, plugins and minigames.

Link: https://www.youtube.com/user/PeasFactory

Answer this question