So you want to learn to program ROBLOX games? Start here!


  • Hey there!

    Chances are, you came to this forum post because you’re interested in making that Mad Murderer clone a reality. You’ve watched a few YouTube tutorials, asked a few knowledgeable friends, maybe even considered buying a book or two (hopefully the Lua 5.1 manual is one of them.) Having done all that, you’re probably still stumped about where to begin. I know I was when I started!


    What is programming?

    You probably already have a pretty good idea of what it is, but others might still have the idea that programming is the act of punching some magical voodoo words into a terminal. In actuality, programming is a lot more about solving problems than anything else. You are indeed instructing a computer on how to do things, but a common misconception is that the computer does all the thinking. Sure, it is thinking (in a way), but you’re defining how it does it. The key here is that you’re solving the problem, then telling a computer how to do it again, usually on a larger scale.

    Why should I learn, or even care to learn?

    Presumably, you already know the answer. You want to make a Mad Murderer clone, right? Cool, though… perhaps you could achieve more…? Think about it, you could go on to make games as a professional, or even become an indie developer if that’s your cup of tea! Maybe… you have fun solving problems, or fear that the future of employment may become dominated by programmers -- something I personally don’t believe. Whatever it may be, have some motive beyond impressing your school friends with a murder mystery game. Programming is quickly becoming very a desirable and lucrative trait, so you’ll no doubt benefit from having some experience under your belt. As you begin (and hopefully continue) your programming adventure, seek to find ways to become the best programmer you can be. You’ll thank yourself later.

    Isn’t programming hard?

    Sure, it can be. Programming is about solving problems, and problems are rarely easy to solve. That said, it doesn’t mean you need to meet any specific qualifications. You don’t need to be a rocket scientist, physicist, mathematician, or Albert Einstein to become a programmer; all you need is wit and determination. In the case of making ROBLOX games, an elementary knowledge of mathematics and a decent capacity for solving logical problems can go a long way.

    In the future, you may end up making a trajectory calculator for NASA, or an algorithm for predicting stock market trends, in which case it would help to understand Calculus, Newtonian physics, or whatever; but you do not have to understand these things as a prerequisite. It all depends on what job you get, and if you’re making games for a living, you don’t have to know an awful lot about any of those things, if anything at all.

    With all that said, programming is only as hard as the problems you want to solve; and quite frankly, most programming languages are fairly straightforward to learn, too.

    If programming is so straightforward, why aren’t more people doing it?

    The truth is, it’s not for everyone. Anyone can do it, but again, it’s not for everyone. Some people simply don’t enjoy telling computers how to solve problems, others just don’t get kicks from solving problems, period. If you don’t enjoy solving logical and mathematical problems, you will not enjoy programming.

    Furthermore, you need to have good attention to detail. Problem solving requires you to be meticulous, and programming is no different. If you are prone to clumsiness, you may not do well as a programmer. However, if you enjoy solving problems, and you are determined, you will succeed. You’re going to constantly face difficult problems, be they problems to be solved, or even problems with your solutions. If you lack the determination to overcome those problems consistently, I say again: programming may not be for you.

    All of this being said, if you do enjoy programming, there are few things you may cherish more than the satisfaction of making a new, better murder mystery game, or solving your math homework in seconds with a specialized math program. For those tinkerers, logicians, and general brainiacs out there, computer programming can be truly fascinating and exciting: it is the possibly single most tractable and expansive field of research and application the world has ever seen. In writing programs, you can achieve many feats considered impossible or impractical mere decades ago. It is truly a wonderful craft.

    There’s one more thing for you to know, though, and it is very important. As a programmer, you are going to have to learn lots of things throughout your career. You’ll probably learn multiple APIs (more on those later) and you’ll often be faced with problems far different than those you’re used to solving. Things you learn today may tomorrow lead to things you have never dreamed of! Indeed, you will need to keep up with those changes, or you will quickly find yourself outmatched by others.

    You’re about to enter the most quickly evolving industry in history; be prepared to solve problems (or even use new software!) that will drive you far outside your comfort zone, or you will quickly become as antiquated and undesirable as a corded telephone.

    WHEW! That was a lot to swallow. Can I learn to code now?

    Sure. There are plenty of ways to learn to program, as well as many aspects of programming to learn, such as individual languages, but I find time and time again that there is simply no better way to learn than to pick up a good book. I’m telling you, if you can muster the patience to sit down and just read, you will learn so, so much. Often, you’ll learn more than you would from online courses and questionable YouTube tutorials. I’ve tried both, and they usually don’t light a candle to a good book. Do yourself a favor, and pick up a book on the language/API/whatever you are studying, even if you do find a good source online. It worked for me, and it will likely work for you. If you don’t like reading books… well, forget about becoming a programmer; you’re dismissing the best source of information at your disposal -- no (good) programmer in his right mind would do that!

    In your case, you’re working with ROBLOX. ROBLOX uses Lua, version 5.1. Here is the Lua 5.1 manual.

    DONE! I AM NOW READY TO MAKE THE NEXT GREAT MURDER GAME!!! :D

    [Laughs hysterically]

    No. Sorry Eager McBeaver, there is yet one teency, tiny problem. Assuming you read the manual (shame be unto you, if you didn’t), you haven’t yet learned anything about how ROBLOX works. How do you move a part, change the time of day, or make an epic missile launcher? You won’t know how to do any of these things until you learn one other aspect of ROBLOX game development: the ROBLOX API. An API, or application programming interface is an interface (hint, hint, nudge, nudge) that your scripts use to tell an existing program what to do. Not only that, but the ROBLOX API includes all sorts of blueprints for things you need to make a game, called classes. Here’s the gist:

    Classes are blueprints for things that you will be using to make your game. Parts, PointLights, Welds, Buttons, Pants, ClickDetectors... the list goes on and on. Each of these classes have a purpose, and that purpose is to help you do a specific thing without having to code every component of that from scratch. Each class has a set of properties you can change, actions you can do, and events that can tell your scripts when something happens to any copy -- otherwise known as an instance -- of that class. In order to utilize the power of that class to its fullest potential, you must know its components.

    And to do that, you have to study something called the ROBLOX Wiki. The Wiki isn’t just a tutorial site. It has an entire page dedicated to explaining everything there is to be known about every class ROBLOX has. Want to know how to change the color of a part? Look up the Part class in the Wiki. Want to know how to change the time? Look up the Lighting class. Want to make a rocket fly into a wall and explode? Check out this article on BodyMovers and the API page for Explosions.

    There is so much more you can learn from this one website, it’s ridiculous. It does have a slight learning curve, and it might seem a little daunting to study at first. Don’t worry, though. This WILL be your best friend when making ROBLOX games. Let’s consider changing a part’s color. To do so, we need to know:

    • What the name of the color property is (hint, it’s not ‘Color’), and...

    • What type of property it is. Note that setting the color equal to the number 9001 doesn’t make much sense, so we should probably find out what its exact type is.

    First, we go to the part’s wiki page, where we find...


    BrickColor BrickColor … Determines the color of a part.

    Eh… okay. A bit strange. Let’s break this down. The first occurrence of ‘BrickColor’ is actually the type. The second occurrence is the name of the property. The last sentence is obviously a description. Consider these other properties:


    bool Anchored … Sets whether or not the object is frozen in place.

    float Reflectance … Determines how reflective an object is. This property should be set between 0 and 1.

    Vector3 Size … Sets the size of the object in studs.

    In case you don’t know what a bool, float, or Vector3 is, you can click the respective link to see an explanation as to what it is. You’re welcome.

    All that said, if we have a variable MyPart that is equal to any Part, we may state the following:

    MyPart.BrickColor = BrickColor.new(“Bright red”)
    MyPart.Anchored = true
    MyPart.Reflectance = 0.5

    There are also methods and events of the Part class you can use, but those are something I’ll let you study in your own time.

    The API is indeed huge, so don’t worry too much about memorizing the whole thing. I’ve worked with it for years, and I still don’t know half of it. All that matters is that I know how to study it, so when I do need to know something, I can find the answer quickly and easily.

    Wow, I am so enlightened. Can I make my murder game now?

    Sure (after you finish reading, though.) Make that murder game as well as you can. Practice, practice, practice as much as humanly possible. The more you study, the more you’ll know and the faster you’ll be able to solve future problems. If you fail to practice, you will quickly forget all the things you have learned!

    Alright! Smell you later!

    Hold the phone, bud! A few more thoughts. If you’re going to get programming, make sure you do it right. Don’t make programs that “just work.” Make programs that are clean and easy to understand (NoahWillCode has an excellent article on this), and always look for ways to make things better. If you never try to make your code better, you might end up being a mediocre programmer (and stay that way.) Programming is worth doing, so do it right.

    Another thing. Remember how I told you to practice? Don’t just practice by making your own things. Once you’re confident in your skills, start looking to help others wherever you can!

    [Cough] Scripting Helpers [Cough]

    You’ll find that, in helping others, not only will you get more experience; you will find solutions to problems you previously couldn’t solve (or didn’t solve as well!) Remember that.

    Th-Th-Th-Th-Th- That’s all, folks!

    I have other thoughts on the subject, but quite frankly, you’ve read quite enough to deserve a cookie. Thank you so much for bearing with me. I hope that you will benefit from reading this article, maybe even one day become a successful programmer. If you’ve got what it takes, you no doubt will have loads of fun. I know I have.

    Have a wonderful day!

    tkcmdr

    (Shoutout to ratchetandclank2, OldPalHappy, and Link149 for proofreading this article, they’re awesome!)


  • First. I love your contribution and dedication to the site. This is a must-read :)


  • This is certainly what I'll be linking to now when I see this commonly asked question.

Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.