Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Flying In-Game Script That I Need Help With Since I Don't Know How To Script, So How Do You Do This?

First of all, I don't know how to script, so i can't really put what I did wrong. What I want for my ROBLOX game, is if you know a script, or know how in some games you stand on a certain brick or platform and it makes you fly to a certain place? Like it makes you fly not that it gives you a fly tool. I want to know how to do that, or what I need to do to find out or do it. Please help, thanks for your help.

-ExtremeBuilder18

1 answer

Hey ExtremeBuilder18,

Boy, where do I begin here?

As a programmer, you are expected to solve a lot of problems on your own. More often than not, you are going to have to not only search for an answer, but find it on your own. A fellow on the Scripting Helpers Discord channel once something along these lines:

Programming is 5% knowing the language and 95% knowing how to use Google.

I can personally testify that he is correct. I have been programming ROBLOX games for three years and counting, and to this day, I still do not open ROBLOX Studio without first opening the ROBLOX Wiki. As much as I have learned over the years, there is always some yet unknown class or function that I might need to solve a problem at hand. This brings me to the single most important aspect of working with any engine/framework ever. Know how to study a manual. I say again:

KNOW HOW TO STUDY A MANUAL!

The manual (or documentation, whichever term you prefer) is a collection of all the classes of a particular framework.

What's a class, or a framework?

Classes can be thought of in terms of real life objects. Your car might have properties like Color or Horsepower, and it may also have functions like StartEngine and LockDoors. Classes can be copied and passed among scripts. Consider the following:

-- Assuming you've made a new `Car` class and have put it in a variable `myCar`, let us say the following:

myCar.Color = "Bright red";

myCar.Horsepower = 150;

print(myCar.Color, myCar.Horsepower);

Our script prints the following:

Bright red 150

For the Car functions, let's say they are the following:

myCar.StartEngine = function()
	print("Starting the engine! VROOM, VROOM!");
end;

myCar.LockDoors = function()
	print("The doors are now locked.");
end;

Let's call those functions:

myCar.StartEngine();

myCar.LockDoors();

Output:

Starting the engine! VROOM, VROOM!
The doors are now locked.

You may well forget all the stuff I outlined above, but understand this: ROBLOX has a bunch of classes, and these classes have their own properties, functions, events, etc. that you can use to make really cool games. In order to use ROBLOX to the fullest (or any engine, be it Unity or Unreal Engine,) you must study this collection of classes (commonly called an API.)

It can be found here:

http://wiki.roblox.com/index.php?title=API:Class_reference

Don't be overwhelmed by the massive amount of information here; understand that you will never completely memorize ROBLOX's API. I haven't memorized half of it in three years. Even so, learn how to read the ROBLOX API, so that when you do run into a problem you don't know how to address, you can find the class or function you need in a few moments.

Such is the art of programming.

It is worth noting that you also have to learn the fundamentals of Lua to write programs (in ROBLOX, at least,) but quite frankly, knowing Lua does you no good if you don't know ROBLOX's API. It does not. Pick up a good book on Lua:

https://www.amazon.com/exec/obidos/ASIN/8590379833/lua-indexmanual-20

Then read it. But don't just read it. Understand it. Write some of your own code. Know how Lua works and why. Then come back to ROBLOX's API, and use each class when needed.

The best teacher is experience

I made a point earlier in this post that you should really practice a lot. I was not joking. Code like your life depends on it. The more you code, the more efficient you will become. You will find unconsidered solutions to problems you had in the past. You will discover new classes, and new methods to make your code shorter and faster. Most important of all, you will be exercising your brain, solving increasingly complex problems by way of sheer brainpower.

Don't just solve your own problems though. Come to websites like Scripting Helpers, Stack Exchange, or even the ROBLOX forums, and answer as many questions as you can. You may find that in answering these questions, you'll learn a lot of things you wouldn't otherwise learn. Answering questions will often expose you to new concepts, or force you to learn new ones. Either way, it helps improve your programming abilities tenfold.

And at one point... everything just clicks. I haven't spoken much to fellow programmers on this, but I distinctly remember working on a game in the past, and suddenly realizing just how much power I had. I don't quite remember what hit me, but I remember from that point forward that everything just made sense. I started becoming exponentially better at making games on a daily basis. I've read of similar things happening to programmers, so I think I can safely predict that you will experience the same thing if you dedicate yourself, which beings me to my next point:

BE DEDICATED

A lot of people jump into programming because they had an idea one day as they sat at their couch and sipped on their iced tea. An idea that they could make a fully-fledged FPS game in a couple of days and impress all their friends or whatever. These people jump onto forums like this and ask questions like yours. Among these people are two groups: one group is ready to dedicate a lot of time and meditation to game development, and the other is not. The latter group ask questions like this and have some fantasy that answers to every problem they run into will be magically answered for them. If you believe this, let me pop your bubble by asking you to read this entire post over again. You are a programmer, therefore you are expected to solve problems. On your own. By way of research and stubborn willpower. If, however, you are in the former group mentioned, good for you. Get ready, because this programming journey is going to be really long, and really fun. Yes, it may be frustrating sometimes, but if you like solving problems, you're really going to like your program finally working after five hours of typing and tearing you hair out. I promise, it's a very fulfilling experience. There will always be a new problem to be solved and a new solution to be discovered.

Welcome to the world of programming.

Well, what are you waiting for? Get studying! :D

Have a good one, ExtremeBuilder18, and good luck on your programming journey!

Best regards, tkcmdr

Edit: Corrected a typo

This discussion is preserved as it was. New answers, comments, and votes are closed.