Intro to scripting

Introduction

Hello everyone, today I have decided to make a tutorial for getting into scripting. Before we start though I just need to clarify that everyone has their own opinions about learning scripting, so we should be kind and polite to everyone’s different thoughts.
So everyone always talks about what things you need to learn to script, however no one ever really talks about the process of actually learning to script. You know you see scripting everywhere and it confuses you. You aren’t really sure how to take these few words and turn it into a fireball or something cool. So scripting is basically learning terms and putting them together. These terms at first glance wont really make a lot of sense, especially to people that consider themselves “visual” learners. An just note if you are a visual learner you will have harder time. Scripting isn’t visual at all, its a lot of reading and typing. It’s very boring at times and usually by time you get really good, you also get super unmotivated.
Now I’m not trying to scare you away from scripting, I am just attempting to give you a realistic standpoint from someone thats been programming for 9 years(Yes this is an alt).
Scripting is very time consuming, I mean you’ll spend hours and hours writing code and fixing bugs. It doesn’t matter how good you get either because there’s always going to be something you struggle with. However scripting is fun in its own way, when done properly. You know fixing bugs can be kind of a thrill, its a nice accomplishment especially when you’ve spent so much time to fix that 1 thing. So I’m not gonna make a full page essay here, but just know what you’re getting yourself into ahead of time.

Getting into scripting

So you’re ready to learn to script? Well alright, the only things you need are studio, and your choice of resources to learn from. Now I wont talk about getting studio set up, theres so many tutorials for that. However I will talk about what resources to use and how to problem solve. So my personal resources are wiki and google. I do not use youtube or the devfourm to fix my problems. I don’t suggest you should either, but its completely up to you.
The reason I don’t suggest youtube is because 95% of the time its mainly someone giving you a script and you copying it then trying to edit it later on. An not to mention no youtube video properly explains the full functionality of something. Like if you see a youtube video on variables they dont explain all of the little secrets hidden with them like you can’t start a variable with a number, or you cant have a key word in a variable, or even that variables can all be typed on the same line. Of course I may be wrong and just might not have seen these videos, you know this just my pure opinion.
Another reason I suggest wiki is because you’re forced to problem solve. Wiki is vague it doesnt give you all the answers and it does its job beautifly. Since the wiki is so vague you are forced to figure out on your own what to do, and guess what thats what scripting is. No one knows what to do in the beginning, we problem solve and work things out. I also suggested google, I put this suggestion out because you will always use this lmao.
Google is great for finding wiki links, definitions to things you don’t know, resources that have already been out, other platforms that that can help you learn scripting, and you can even search up the actual lua website. You won’t go to the actual lua website at first, because lua and roblox lua are 2 different things. However wiki does reference it from time to time, and you can learn more about specific math when you get more advanced. Oh and one more thing thats great about the wiki, the wiki has blue hyperlinks on every page. Why is this great? It’s great because if you’re struggling with learning new things you can literally go to a random wiki page and find new things just by clicking hyper links. Its pretty fun to just navigate around.
Alright my last little thing before we get to the links is PROBLEM SOLVING :smiley: . So what is problem solving? Well its basically you having a bug and error and you needing to work it out to fix it. What is not problem solving? It’s you coming to the devforum or any other resource and asking for help. Basically what I’m saying is you wont learn to script if you’re always getting the answer from someone. You’ll never be able to make advanced code or be really efficient. An not to mention when you get the answer from someone, else chances are you’ll have that same problem in the future in a different from. The thing about scripting is when you make something it correlates with another thing. So essentially if you were able to make a dbz beam clashing system you could make a party system. They deal with the same aspects in certain ways and thats how they relate with eachother. Now if you were to have a problem with the clashing system say when you were finding the other player, chances are you’ll have that same problem later if you got help. An I am not saying you should never get help, its just the majority of the time you should work it out yourself. Also if you have a problem, before coming to the devforum and asking your question, just google it. All you have to type is Roblox wiki(question here) or Roblox devforum (question here) Example roblox wiki how to change a color of a part. I say this because so many people ask the same questions. Roblox has been out for so long, chances are if you have a question someone else has had the same question and has gotten an answer already.

Links

https://developer.roblox.com/en-us/articles/Variables
https://developer.roblox.com/en-us/articles/Scope
https://developer.roblox.com/en-us/api-reference/property/Instance/Parent
https://developer.roblox.com/en-us/articles/Conditional-Statements-in-Lua
https://developer.roblox.com/en-us/articles/Operators
https://developer.roblox.com/en-us/articles/Loops
https://developer.roblox.com/en-us/articles/Function
https://developer.roblox.com/en-us/articles/Table
https://developer.roblox.com/en-us/api-reference/class/DataModel

Now I suggest reading these in order, it will benefit you a lot more if you do. If there is a word you don’t understand make sure you google it. If you don’t understand something at first, go to another page read that then come back and read it again. Note you can click those blue hyper links, it’ll take you all over the wiki and you can easily learn the basics just by traveling through the wiki using hyperlinks.

Additional Comments

Now again let me say that this is my complete opinion of how scripting should be learned. If you have a different way, feel free to provide it. You know this is a resource its supposed to help people, so if you have additional information to something please add it. Other than that I appreciate that you took time out of your day to read this, and I hope the rest of your day is good. :smile: -Also sorry if some of the information is spread out/lacking. I wrote this in 1 go and I think I got distracted on some points q.q

7 Likes

Nice tutorial but,

what’s different in this and responses to literally 70+ other topics and posts of the sort?

https://devforum.roblox.com/t/a-scriptures-guide-to-scripting/

https://devforum.roblox.com/t/scripting-tutorials-that-will-help-grow-the-community-of-scripters/563109332591

Compilation of resources

+More than 50 topics with very similar contents
compilation

Another thing:

Other than API members and custom globals in Luau of course, everything in Roblox Lua is syntatically compatible with Lua 5.1 so I wouldn’t say Lua and Roblox Lua are entirely different worded like that, although as Luau evolves they become very dissimilar.

5 Likes

This is not substantial enough for this category, and many scripting resources already exist.