Starting to learn Roblox coding

Roblox Studios is the application that you can build games using. I have found the ramp into this world and related code you can get quickly to be very dicey. There is a lot of code you can simply add to your project and gain the benefit of so much existing knowledge, but that is also unmonitored and can include player-created viruses (yes, for real) and… just bad code.

So much of the ramp-up is learning when sample code you are studying is just poorly written. Google helps a lot here as the documentation is written more as a reference, not a guide. YouTube videos are helpful, but also note that you may need to watch several different ones and piece together what works or does not work on your own. There is also a lot of content that is simply out of date and doesn’t work in the current version of Studio.

The concepts I first grappled with and learned were pretty important. Each game has a server-side controlling process and then multiple client-side game processes (one for each player). This setup uses a remote event to communicate between them, so something simple like having an event timer running means you need to maintain that timer on the server and use remote events to continually update every client.

Other early items I learned were about how graphic user interface objects (gui) are copied and replicated in the game for every player (so to update them you need to again use remote processes or other tricks), you can store and update data in a server-side datastore (but local clients -cannot- interact with it, so you have to manage logically with server-side processes and perhaps iterate through all players if you want to do a mass update), and then the mechanics of positioning and movement.

My current struggle is animations. Even something very simple like grabbing an existing weapon Tool, adding it to your game, then getting it to animate the swing is a … nightmare. Nearly everything I studied on this made massive assumptions that you know what you are doing. That you have to get a dummy “rig”, get the animations in there, but then Export each on to your own server-side library (and then remember the cryptic Id) and then hook that up – and how to hook it up? I mean, nightmare. I still have a long way to go on this, I’m just happy I hacked in a broom swing that is reasonable for this stage of the game.

So my progress is that I have a functioning prototype that has the ability to start a level, get a set of baddies to come, you can sweep them away to get a score, it has a timer, the score adds to your cash at the end of the level (and that is sticky so you continually build it up) and you can repeat the level. Honestly, not bad for this state.