Learning to script gives me immesurable amount of mental pain (rant/venting)

Haha. For 4 years, I just focussed on building and modeling since I had no idea where to start! Scripting then just suddenly made sense to me. It was weird. I started just reading the API, making small projects, and learning as time went by. You’ll make it.

Edit: If you need any small help, I am always here.
Discord: a person#8122

Isn’t API something related to roblox servers? Or it’s a site?

1 Like

API reference manual:

Try using a Python tutorial on W3Schools. Learn stuff in Python, then relearn it in Lua.

You can also try a table of contents of another programming language tutorial book and then follow what it says but learn in Lua. For examppe, if the table of contents says to learn if statements learn if statements in Lua.

If you feel like you aren’t interested at all when learning how to code, maybe you should try learning something else. It is hard for me to learn something I dont want to learn, and so I usually stop learning it

Also, I forgot who made this, but someone made this rresource with links to videos about scripting. Watch the videos in order and they should help you with learning Lua a bit. Here is the Google Doc LearnLua - Google Docs

An API is a term for “how you interact with some system”. Sometimes that system is a website, and the API tells you which URLs will give you which information.

Sometimes that system is ROBLOX, and the API tells you how to do things like “create an instance” or “trigger an event”.

Sometimes that system is an operating system like windows or macOS, and the API tells you how you can write a program that “opens a new window” or “plays a sound on the speakers” or “writes to a file”.

1 Like

yes, there are two types. The Roblox API related to the actual roblox site, and the Roblox game api, which controls the parts in your game.

An API stands for Application Programming Interface, which is just like a control panel thingy where you can use code to control or change something.

Google is an amazing resource and searching “roblox scripting” or “roblox lua” followed by “tutorial” would probably get you exactly what you claim to not be able to find. Don’t blame failure to learn on other people, because ultimately you have the ability to use the internet and do research or find resources. The Roblox wiki also is an excellent source of Roblox scripting information and tutorials, so I would personally start there.

First step is to not be lazy. Laziness and defeatism is what separates the people that can do something from the people that want to do something.

Second step is to find learning resources you like.
My best advice for learning is to just dig into something someone else made that you think is interesting or would want to make/write yourself. Study it a bit, try to understand how things work and what they do, and then try to modify it a bit. If you hit something you don’t understand, search for it online, on the wiki, or ask people. You’ll probably mess up at first but then you’ll debug it, figure out why it’s not working (using people here, the internet, etc. if necessary) and then you’ll understand what you did wrong and how to not do it again. Obviously, just because this works for me doesn’t mean it will work for you, so ultimately it comes down to you figuring out what the best learning method for you is. Programming (Scripting/coding/keyboard mashing) is something that can only really be learned by doing and is probably near impossible to truly master.

It might take a while but it’s important to remember that anyone who ever learned to do anything also went through the same struggle and programmers are no different. No one wakes up with a mastery of something they knew nothing about beforehand. Possibly years of time and effort went into any perceived mastery of anything.

Here’s some coding tutorials from the wiki that might help you along the way:

The best way to learn scripting is by doing. Being lazy and having a lack of time is a curse, because anything you do manage to do will probably be forgotten.

Simply working on small projects will teach you a lot. You don’t have to complete them, in fact you probably won’t. What matters is proof of concept (Can you make the sword do damage in this sword game project) which later on you can use your experience to build bigger and better experiences. Don’t do anything ambitious. Do something that would take you ten minutes. In fact, I started my scripting career with figuring out how to color a part red when I stepped on it.

It is true though, that if you have had experience with prior coding languages, scripting in roblox will come much easier because the logic is there. Different languages don’t really change much - the coding logic is still there, just the syntax will change.

In the end, I found that most videos and tutorials were pretty useless - I’d rather have a piece of code that worked and fiddle around with that to learn then to have info spoonfed to me, but for the more confusing concepts videos are viable. The most important thing to do, in my experience, is to at least do something regularly. It could ludicriously simple and easy, but as long as you’re working and learning it’s worth it.

Don’t think you’ll start working on a rpg and finish in a couple months. That’s too long of a commitment. Think about creating an xp system, then a sword fighting system, then a data saving system, etc… actually completing things gives you far more motivation than working on something for weeks only to give up and feel like you haven’t done much.

2 Likes

I use google and just slap on roblox at the end of my question or keyword. That usually helps me get to what I want either on the Roblox Dev Hub or a question like mine in the devforum.

1 Like

Oh, and I also discarded several games before because I used them for the sole purpose of testing. That’s how I learned.

1 Like

Everyone are telling me to do a small project. Ok, BUT HOW?

dramatically opens thesaurus

hour a day (insert elon musk laughing meme)

I can speedrun getting grounded and do it for 8years

Then i realize no one cares

TheDevKing basically helped me learn almost all of what I know today. I found his tutorials easy to understand and they got right to the point.

Clicking under playlists will show you Advanced Tutorials and Beginner Tutorials.

That’s what i used. Still have no idea what is function and print

function is a literal function, when called on, it will run the part of script inside of it. Print will print whatever information is put in-between the parentheses into the output view, accessible in the view tab.

What don’t you understand about them? I will try to explain the best I can!

Starting a small project is easy. Here’s a quick tutorial for the door.

local sound = game.Workspace.SOUNDNAMEHERE
local door = game.Workspace.door

function onTouched(h)
    h = h.Parent:FindFirstChild("Humanoid")
    if h ~= nil then
        Play:Sound(SOUNDNAMEHERE)
        door.Transparency = 0.7
        door.CanCollide = false
        wait(5)
        door.Transparency = 0
        door.CanCollide = false
        Sound:Stop(SOUNDNAMEHERE)
    end
end

script.Parent.Touched:Connect(onTouched)

This script was pulled from the wiki for detecting the touch, and could pretty much be repurposed. But remember, as I said, try to understand the coding here. It will take only 2 minutes. If you need help with understanding it, I will try and explain how it works!

The original script was pulled from God_Zeal’s post about a kill brick: Instantly Kill on Brick Touch

I literally had no prior scripting knowledge (other than Scratch which is block-based), and I learned Lua as my first scripting language and now I already made two whole games with my team, with me being the only scripter. I would say a great place to start for beginners is AlvinBlox. He does a really great job for starters to follow along. You really should check it out. And finally, have fun. If you don’t like scripting, find something else to do that you like.

My first project Orb Battle didn’t become successful or anything as I was scripting it and learning how to script at the same time. Overall, the project took 6 months to make, with me not even knowing how to write a line of code at the beginning. The second project Hide and Seek Shooting is currently launched and advertised on Roblox, which we completed in about 3 months. I built the base for the code in the first month and the rest is all dedicated to debugging. Even after launching there were so many bugs to fix that’s driving me crazy. But after around another 2 months of debugging after launch, the game is pretty good to go.

Adding on to my previous post. I would recommend mostly sticking to the devforum API, making small projects, and just browsing the devforum. Don’t feel like you have to finish the small projects, it’s mainly just helping you learn. I never had the energy to finish some projects but they helped me learn. I don’t know about anyone else, but videos or tutorials did not help me what so ever. For some people, tutorials help them. If you think tutorials are helping you, then without a doubt you can continue them. If you feel the videos are not impacting you then don’t waste your time on them.