I have been scripting for about 4-5 months and i have l learned all the basics and most of advanced stuff. The problem is that every time I try to script something I cannot connect 2 pices of code together. I can only do it while following tutorials, I heard it is called “Tutorial hell” or something.Is there anything I need to learn? or any practise I can try to improve? This may not be a serious matter to someone but it is to me, so please help me.
If you want to understand the Lua Programming Language, you must learn the magic words in the Lua language. (e.g. print
, while
, return
)
Your job as a programmer is to find the solution to a problem, understand how to fix it, then write it down in Lua code.
If you don’t understand a magic word, research it. Roblox has a website dedicated for how Roblox Studio works and the Lua language.
Of course, you can use tutorials, but I recommend asking for help if you don’t understand how something works, or if you don’t know how to fix a problem.
The print function is realy usefull for finding bugs and the other functions are usefull as well. Thanks for the advice.
Do you know how to use for loops it’s really handful especially for ui togeling
Youtube tutorials are not the best to use when you want to self-educate yourself. Go to youtube when you want an idea on how to start a project because you’re stuck. For example, I wanted to make a minimap today but I didn’t know how to start, so I went to youtube and found out I needed a viewport frame. There are people online who’ve been scripting for years and thus will give you the tools to get started. The main way to learn scripting is just by practicing daily. There are many ways to do this:
- Break down free models in the toolbox to learn how the code in them is built. This will help you learn methods and events by yourself which you can use in the future
- Use developer tools. The DevForum and Documentation exist for you to seek help and knowledge. If you are active enough each day, you can learn from these tools better than other means.
If you persevere enough day, a key aspect of a good programmer, you will learn to script well eventually. You have to be patient as skills do not come instantly. It can take months or even years, but stay motivated and you will be able to script without tutorials
Thank you for your advice, the only thing i don’t know is how to use documentation and devforum well, everything else I can try and do.
When in doubt about smth you do not know eg. What in the world is :SetNetworkOwner() then you can go to the docs and look it up. No one can explain it better to you than the docs. As for the devforum, post topics regularly, participate in other topics by replying and you’ll learn eventually
Force yourself to not use tutorials. Most problems don’t have a tutorial so make one up.
Most of all, always question why it works.
I will try. Thanks for the advice once again
I had the same issue when i started out scripting. I came up with a solution for myself when i found it hard to remember some code or forgot what a line of code meant.
My solution:
I would write some code with a toturial, I would then proceed to close the toturial analyse as much of the code as possible, make a new script and write down as much as I remembered.
After writing everything I could remember, I would switch between the scripts to finish it. And I basically repeated that process for about 2-4 times.
Another solution:
In each script you have, instead of looking at it as just code, try to form some sort of a short story in you head that is simple and something you understand.
You could also try puttig a phrase ( --example ) after some lines of code you find difficult to remember.
Trial and error is the essential part of learning just about any skill, especially when you’re teaching yourself. If you move on to learning something else too quickly, with not enough repetition, without adequate trial and error while trying to mess around with whatever it was you were just learning, your brain likely won’t retain this information in a way that you’re able to use practically.
If i’m stuck i usually search up the error message on google: roblox devforum how to do this.
honesty. thik of somping you want(make it simple) and just do it!. keep in mind you dont need mutpule scrpits for everything(that helped me). if you cant do it do sompting smaller. also periods are for tings with the instace : are for thigs that just kida have to do with le intance ( sorry for the bad spelling trust me when i script i speel better lol)
Thanks, thats one of the better advices here.
I don’t believe this is the right category, but I’ll tell you my recommendations as a Lua(u) developer for 10+ years.
- Familiarize yourself with Lua itself - remember key things like syntax, keywords, loops, operations, tables, etc.
- A lot of game development on Roblox is just memorizing the engine and it’s API - properties, classes, functions, data types, etc. - You’ll start memorizing these the more you create numerous variety of things. If you don’t remember, familiarize yourself with the documentation, your best of friends.
- Remember, everything you want to create are just smaller steps put together smoothly and logically. Say you want to make a dance floor that has tiles changing into a random color every second: lay out your steps.
- Okay, well we first need grab every tile child in a Model. After searching google and the documentation, you come across the GetChildren function.
- Next, we need to create a loop that lasts forever, repeating every x seconds, and a loop to go through each tile part. This is something you should already know from the basics; otherwise, it is indicative of lack of fundamentals or familiarization.
- Finally, we need to color it randomly. After searching the documentation, you will see that the Part class inherits properties from the BasePart class which contains a Color property that accepts a Color3 data type. Seeing as Color3.new accepts 3 arguments (red, green, blue) between the numbers 0-1, we can use math.random to generate these values for us. But wait! The BasePart class also contains a BrickColor property (something we typically use in Studio) that accepts a BrickColor data type. After clicking through some links, tada: BrickColor.random is a built-in function we can use to skip the math.random process.
- After breaking it down, you will have a much easier time creating more complex systems:
-- we grab our tiles from our dance floor
local tiles = workspace.DanceFloor:GetChildren()
-- we create an infinitely running loop
while true do
for _, tile in tiles:GetChildren() do
-- critical thinking: what if we added something else in this Model
-- that is not a class of a BasePart? it will error! Start thinking of
-- situations that the code can error to catch them early.
if tile:IsA("BasePart") == true then
-- generate a random BrickColor
tile.BrickColor = BrickColor.random()
-- or if you want to use Color
tile.Color = Color3.new(
math.random(),
math.random(),
math.random()
)
end
end
-- we wait 0.5 seconds before running the loop again
task.wait(0.5)
end
Tutorials themselves are fine if you have troubles breaking down what to do; however, do be careful as I think a good chunk of them online are outdated and/or use bad practices. There are a lot of tutorial articles on the documentation from Roblox themselves that I think are better alternatives.
Good luck on your journey!
i see you’re kind of in the same spot i was in a year ago
unable to rely on myself (or yourself in your case)
i made a topic similar to yours a year ago, i got some nice replies on there incase you want to see some advice
(this is not self-promo)
i don’t have anything else to input from my side, but i do suggest digging around that post and reading a bit
I’m now learning from scratch with this game
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.