Help with learning scripting

Hello everyone!! This is my first post here, so I really hope I put everything in the right category.

I’ve been trying to learn Roblox Lua scripting, but I’m really struggling. YouTube tutorials just don’t work for me and I get distracted very, very easily, and it’s so hard to stay focusedd.

I’ve tried learning multiple times, but every time I take a small break to avoid draining myself, I end up forgetting everything I’ve learned. It’s really frustrating because I want to get better at it, but I feel like I’m just going in circles. ://

Does anyone know any good sources or methods for learning Roblox Lua scripting that might help someone like me? Websites, or any other resources would be great.

Using the Lua site didn’t really work out too much for me either, as it seems mostly targeted towards people with knowledge in other languages. I might be wrong, but regardless, I’m still struggling to understand it. English isn’t my first language either, which makes it even more difficult. I also don’t think using scripts from the toolbox is really going to help me much. I’d really appreciate any tips or advice you can share.

4 Likes

if you’re forgetting everything you’re either trying to learn too much in a short timeframe or you’re not actually putting the obtained information to use, so your brain would just dump it out as its viewed as unnessecary. On the other hand, learning too much just dumps out old information to allow space for the new one.

I don’t know how long you mean by “short breaks” but if you’re not using the information after learning it, you’re bound to forget it.

When learning information, you need to give the mind time to process and store that. Take breaks from learning and don’t try pull all-day sessions on learning whatever you can. if you want to try space this out I find taking breaks help with this. I always come back with a fresh mindset and can take a new approach to an issue i’m having.

I think a large issue with scripting in general is that there isn’t really a “starting point.” there are basic things and more complex things so i’d look at the things that arem ore simple. in terms of what you actually want to learn it really depends on what you want to do.

I’m not exactly experienced myself, I still run into issues frequently but I do have an OK understanding with the lua language. I originally started rather ambitious and attempted to create a basic Core System which is actually still up on an older account.

Obviously, many of the mechanics don’t work as intended but it’s still something I had to work on. working on it allowed me to focus and concentrate on specific pieces of LuaU since I only needed to know what I needed.

Its similar to Learning Blender, it seems titanic by itself but once you break down what you want to use blender for, it becomes much more personalised and easier to understand since you’re looking at it in the perspective of the things you only want to specifically use it for.

The dev hub is a good place since the basic documentations are consise and hold examples of use cases for the property you’re looking at. The dev forums (this place) is also helpful if you get stuck on any of those with experienced people being avaliable to help you out.

Youtube also helps for some, I’m not sure what your plan was when using youtube, looking up basic scripting tutourials probably won’t help since what the individual may teach you will vary. It becomes more helpful when you know specifically what you want.

basic examples of things to learn could be:

  • Printing
  • Functions
  • TweenService (I heard this is a common example)
  • RemoteEvents / BindableEvents
  • Basic Tables / Dictionaries
  • etc.

These are only examples, again, i’d encourage you to lay out an idea of something you want to make and look up what you’ll need to do to achieve that. it doesn’t have to be an entire game, it could just be focused on a specific thing like a coin spawning a ball when clicked or so on. as long as you’re experimenting with the tools at hand you’ll not only get a grasp of how to use each one but you’ll also identify new ways to use those tools.

I understand that if english isn’t your first language, this may be more difficult to learn. I’ve always viewed Lua/LuaU and all other coding languages as… Languages. And one’s approach to learning coding may be similar to how they may approach learning a new language. you aren’t just going to try learn as many words as you can, you’ll want to try learn the words you feel you’d use the most, then the words you want to learn and then expand it from there.

You mentioned looking at other scripts to learn stuff doesn’t help you. this is true for others; if you don’t understand what the script is doing then this won’t help at all. This is more for people who already have some understanding of the language so they know whats actually happening in the script and can identify the path taken to reach the script’s output. if not, they look up the part of the script they don’t understand.

5 Likes

These are the most important parts, however if you are struggling to find motivation to do something just listen to music. Which is what I do and it helps me a lot to concentrate.

1 Like

I never claimed them to be. I misread your post, apologies

what’s important to the developer depends on what they actually want to achieve… A tween is going to be extremely useful if you want a part to move smoothly from one point to another but not if you’re trying to animate an NPC walking around (in which Pathfinding would be the most important thing here.)

2 Likes

i’d suggest setting a task for yourself, then playing some jazz on youtube, atleast that’s what helps me stay focused

distraction is something you must overcome sadly, you’re just not focused enough, or you need to get that dopamine in by checking your phone or whatever, this will go away if you want it to go away


this shouldn’t be happening, your “small” breaks are either too long, or you just haven’t learned properly

every programmer is gonna forget what their code does if they take a break from it, so don’t worry about you being different

to fix this, you could simply make comments -- this is a comment to note down what your code does, not only does this make it easier on the eyes but it’s also gonna make future you thank past you

an example of this could be:

-- // PLAYER AND TOOL
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")

local mouse = plr:GetMouse()
local tool = script.Parent

-- // SERVICES AND EVENTS
local RS = game:GetService("ReplicatedStorage")
local Event = RS.RemoteEvent


-- // ANIMATOR AND ANIMATIONS
local animator = humanoid:FindFirstChildOfClass("Animator")
local Animation = tool:WaitForChild("Animation")

-- // COOLDOWNS AND STAMINA
local Cooldown1 = tool:WaitForChild("Cooldown1")
local Cooldown2 = tool:WaitForChild("Cooldown2")
local Stamina = plr:WaitForChild("Stamina")

if you find that code confusing, don’t worry about it, just focus on the comments

future you will thank past you for making notes and organizing your script


don’t use the lua site, roblox uses their own version of lua called luau, you should use roblox documentations instead

while we’re at documentations, learning how to decipher them effectively is something you might want to learn to make your life easier, or you can ask gpt to decipher it for you

if you can’t find something in a documentation by scrolling, you can always search it up manually

can’t find tween service? search for “tweenservice” or “tweenservice roblox” in your search bar


english isn’t my first language either, this shouldn’t necessarily be a problem since i think your english is good enough for luau

as long as you learn what an array is, what a function is and so on, english isn’t really a problem

unless some programming expert starts speaking in complicated language, you should be good after you learn the basics


debugging code is another thing you’re gonna be doing most of the time, remember that programmers spend more time debugging code rather than writing it

the simplest way to debug code is using print statements to see what runs and what doesn’t

as an example:

local BoolValue = workspace.ValueName -- BoolValue is just true/false
print(BoolValue) -- this will print the name of the value

BoolValue = false -- this will error because you're trying to set an Instance to false, which can't be done

-- instead you need to refer to a property that you wanna change, in this case it's changing the Value to false
BoolValue.Value = false

function balls()
if BoolValue.Value then return end -- this line will stop the entire function, this is because a function will stop running the second it comes across a return

-- additionally, why am i not checking if BoolValue.Value == true? because that if statement is essentially "if BoolValue.Value exists then", think of it as having that value on true makes it exist, and having it on false gets rid of it

print("Goodbye World!") -- this will not run, because there's a return inside the function
end

as a beginner, you’d probably not use that print statement and get confused as to why that code doesn’t work

if you can’t find a fix to your code, remember that this place exists

but know that print statements are your best friend

do note that “return” will not stop :Connect(function()

confused what i mean by that?

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local tool = script.Parent

tool.Activated:Connect(function()
if tool.Parent ~= char then return end -- this checks if the player is currently holding the tool, if not, then don't run the function

print("Activated!") -- this will print if the player has the tool equipped
end)

don’t get demotivated if the fix comes out to be in plain sight, everyone makes this mistake

sometimes the fix is complex and you’re aware of it
sometimes the fix is simple and you’re not aware of it

sometimes you overcomplicate stuff, and that’s okay

1 Like

do not memorize, familiarize, DON’T only watch tutorials, but practice which what you have learned too, even if it’s barely any

get better at focusing, there is no way you will learn if you can’t do that

1 Like

Well a great place is the Roblox documentation If you’ve already learned the basics of LuaU syntax, you can dive into the topics that interest you. After reading through the documentation, try creating a small practice project. It can be something based on an example from the documentation but with your unique twist or something entirely new.

It’s important to understand what you’re writing, so consider leaving comments before declaring functions or performing calculations to explain your thought process. Remember, programming is fundamentally about problem-solving. The best way to learn is by practicing. When you encounter a bug, don’t give up immediately. Try to solve it yourself using print statements and carefully re-reading your code. Solving issues on your own will help you learn and remember concepts more effectively.

The best thing you can do to not forget anything is to make small projects

1 Like