Entry to Scripting Advice?

Entirely a builder when it comes to development. What would be some advice for getting into scripting?

Taking apart basic scripted models and trying to understand how they operate, going entirely off ROBLOX tutorials, any others or all three?

My end-goal is to be able to script first-person WWI style weaponry for a game I’m working on revolving around the movie 1944.

4 Likes

This was a way I learned, except I also changed a few aspects in the tutorials.
But a very large part of me learning was doing it in my spare time just making whatever (Basic Minigames. Guns, etc)
Motivation is generally the only giant obstacle I can think of. Time as well, Lua may be one of the easier languages. But still requires a lot of practice to get a hang of.

I myself tried doing this but it just didn’t work for me at first. It only began to help in learning after I got a simple understanding (About 1-2 Months after beginning to learn)

Also don’t be afraid to Google tutorials (or search the dev-forum for your question) when it is needed.

Before I go I’m gonna ask: WWI or WWII? Because I’m fairly certain 1944 was WWII.

4 Likes

Must be WWII, thinking back. I know the majority of the movie revolves around trench warfare. Which I always was under the impression was WWI.

My mistake, but the main idea of the game would be trench warfare + bots. It isn’t something I have seen any other developers do. Most WWII games are either very old, don’t involve just trench warfare, or don’t have bots. (Non have bots actually.)

On Roblox at least…

Three basic rules to remember when learning programming

Note - this won’t directly answer your question - but will provide you a decent basis for self-learning - which is something you will need to learn to do.

When it comes to Any programming language - you have to remember two things.

  1. Computers are dumb - They can only take Precise instruction
  2. Most programming languages are the same - it’s their grammar or syntax that confuses people.

Let’s say you wanted to change the colour of a part named 'Steve’ in your game to Red

At the moment you will likely use either the colour tool in the Ribbon bar, or (hopefully) the explorer and properties window that you can open in the ‘View’ tab on the ribbon bar.
For anything scripting - you will need the explorer and properties windows


Let’s just go over these steps:

You would do this by selecting the part - going to its properties - clicking the colour property - picking the ‘red’ colour.
Simple right?

Sadly as mentioned computers can understand the above sentence, so how would a computer do this?

game.Workspace.Steve.BrickColor = BrickColor.red()

To get specific - you could say

game.Workspace.Steve.Color = Color3.fromRGB(255,0,0)

In case you don’t know - RGB represents 3 numbers (Red, Green and Blue) which scales between 0 (darkest) and 255 (brightest)


So the Syntax or grammar of Lua is the dot ( . ), and you specify which object you want to select by using exact names (a Part in Workspace called 'Steve').

You’ll notice also that name of the property we want to change is the exact same name as you would find in the Properties windows.
This means that any property in any object can be read and changed by a script.

The third and most important point

You need to learn where to find answers.
These Dev forums are great for trouble-shooting, but you should try to solve a problem thoroughly by yourself first. This way you’ll be practicing your logical skills - and should you need support you’ll be able to see what differences made your project work.

The two best resources to use is the Context Window in Roblox Studio (under View tab) and the Developer Hub (which replaced the Roblox Wiki).

Another great tool is the Object Browser which you can also find in the View tab - this will list all objects with their properties, events and functions as well as a brief description.


If you have any questions - hit me up.
14 Likes

Addition to all I see above, I would suggest you to be patient. Patience is important. Do not start to that big game until you know you can do it. Try yourself with small tech that you would use in that game. Also, making a small game which you can finish in a very short time like one week teaches you tons of things, but of course that is something you should do when you believe you are intermediate.

1 Like

Yes - this was one big problem for me at one point - I would set the bar too high - couldn’t do it and then give up on a project for a while or the project wouldn’t get finished.

A great way to practice is to just work on very small projects.
Here’s some ideas for you (brackets show what you can learn from them):

  1. Disco ball (random colors, loops)
  2. Flashlight (tools, lights and mouse click / activated event)
  3. Time of Day Script (while loop)
  4. Lava Brick (part Touched event, humanoid)
  5. Slingshot (Instance.new, velocity, physics, hit detection)
  6. Ray cast gun (Ray.new)
  7. Animating character (animations, humanoid).

Of course there’s a lot more you can learn but these should teach you some good principles - as well as give you something to practice. :slight_smile:

9 Likes

There’s some great advice in the above posts and I’m glad to see you mention looking through code and figuring out how it works - personally I found this was a great way to learn.

However, you should bear a few things in mind:

  1. Code you look at may use very bad practices and you should make sure you really understand what it’s doing and why it’s been done that way before you attempt to write similar code;
  2. Code you look at may also have been written as much as 10 years ago and as such may fall below today’s standards in respect of FE compatibility;
  3. Creating a FPS system isn’t an easy task, so don’t worry if it feels like a slow process getting to where you want to be!
8 Likes

When I started scripting I believed I was playing around with Free Model scripts. I slowly learned from them then I started reading the Roblox Wiki for more info. Now today I just read the wiki only. Some people may say this is a bad way of learning how to code and I must agree as some scripts may teach your bad methods of coding.

Just go onto the Wiki and take it slowly step by step don’t expect to become instantly good or “alright” at scripting.
Learn:
print
loops
if statements
making instances - Instance.new(“Part”).Parent = workspace (Creates a new part in workspace)
module scripts - How they work and their main purpose

There isn’t really a “fast” shortcut when learning how to code sadly. I am willing to provide further help if you need some.

3 Likes

I learned my coding by taking apart the games that Rudimentality open sourced and playing around in Studio for hours on end. It kind of just went from there. There really isn’t a proper way to start coding, you just need to start where you’re most comfortable with.

Not going to spend time writing another giant response though, a number of people above have great solutions provided.

1 Like

What I did when I first got into scripting was:

  • Looking at free models, specifically ones that contained scripts, and studying how they operate, etc.
  • Frequently referencing the Roblox Wiki (now the Developer Hub) and experimenting until I was able to self teach.

This should have enough resources for now as I am still updating this thread.

1 Like

Prepare to do a lot of screaming at how frustrating it can be.

6 Likes

Very late reply, and I’m certainly not a beginner scripter, but also not very good, but I’d honestly learn what certain objects do and their properties. This has helped me alot, and knowing what properties do what, really helps a ton.