Why scripting is so difficult?

I am wondering did you guys find learning scripting was hard. Now I have been learning it for a month(I am noob) and I understand every concept behind. But whenever I want to write something else or make a small task there will be a bunch of bugs and I can’t fix it. Does everyone experience this period like I a demotivated when there is a bug in my game and I want to quit scripting after that. What to do to make less bugs and master scripting. Everyone told me that scripting is easy, or should I quit scripting forever and do something else?

1 Like

That’s why the DevForum exists. Asking questions is a way of learning. You don’t have to be a walking cyclopedia of every function, method and property that ever existed in Roblox. When you’re unsure about something (e.g. DataStores, Raycasts etc.), you can always do a quick google search for a guide about it, or read about it on the Roblox Docs. Over time, you’ll begin to get used to concepts and be more comfortable with Scripting. It just takes time for everyone!

Again, it may just take some time to master scripting in general. Of course, you’re welcomed to experiment other areas of development, such as UI designs and modelling.

2 Likes

Every piece of code we all write has bugs. We just work through them one at a time until the code starts to work. Use the Output window to check the bugs and it will give you a good hint as to what is actually wrong with your code.

1 Like

It’s essentially like learning a language but with more or less strict rules to adhere to. There are some technical know-hows to understand how the machine works together with the instructions written in it. You could try to take the approach of grammar(linguistic term) to understand the usual fundamentals of programming in general. Because most terminologies are borrowed from the linguistic analogies.

3 Likes

I made manual for programming, there are 2 parts now, about 21 tutorials, here is first one: Scripting Manual
you can find second at the bottom

Also, it’s pretty hard to come up with idea how to write actual code, in more advanced systems you ever become crazy about alternatives to your code or you think your code is bad

To prevent this, i would give you simpliest possible advice, before programming, first take paper and pencil, then write what you want to do

after that try to break down your system into pieces, from less detailed to more detailed like that:

Part A:

  • Something
  • function
  • remote

Part B:

  • effects
  • events
  • destroy tree
  • give coins

Part C:

  • buy axe
  • explode house
  • spawn nuke

After this write possible solutions to every detail, and what to use like what service or what function ect.

at the end search for alternatives that are better, also remember about good practices and write clean code soo mistakes can be easily spotted

when you are ready to write code, then sit, create script or system or structure, and start to write using your schematic, also keep in mind that some stuff might be useless, soo think as a player: what it will do, and if it’s really required for this script to work properly (i did few mistakes when creating data stores, i checked in 3 loops if some object exist, when it must existed when data were created, soo i removed those statements)

When you wrote your script, test it, if it doesn’t work, then try to fix mistakes by prints and warns, also check if something is wrong maybe

If your script do work, test it, then ask yourself if it’s good and test any possible bug, also in multiplayer, if it’s good then congrats, you created properly working script

When you start out things will be very difficult, just keep trying and evantually you’ll have enough knowledge to fix most bugs and problems, tis all a matter of learning

1 Like

Scripting is difficult, but that’s just a part of it. It’s also really rewarding, and the backbone of every game you see. Sometimes there are errors, but most of the time it’s just a small thing you’ve accidentally overlooked or something just barely related to the problem. Take some time and work on smaller projects, nothing is impossible.