Help with scripting properly. (SCRIPTING MORE DYNAMICALLY)

Hello, I’m Den_vers and I have a question. I always have made experiments in Roblox Studio, and am getting better at scripting, but every time I try to make a game, I just rush into it, run into a problem, try to fix it and then give up and move on to another part of the game. I just want to learn how to script thoroughly and properly, and actually make a full, working game.

It’s not because the WAY I script, or that I’m not GOOD at scripting, it’s that… well I guess I’m really not good at scripting and no projects I ever make turn out right. Can I even make a functional game with the knowledge I have? Or am I just rushing into it all? Or does it even matter how you make the game, as long as there are no errors.

I just want a few examples and tips on ways to script like if you wanted to display a GUI on everyone’s screen. You could use a for i, v in pairs() loop to create a GUI object, and then parent it to each player, or you could already have the GUI inside of StarterGUI, and just set it to gui.Visible = true. Or another problem, what if you wanted to create an equip-attack system where you had a hot-bar that you could click, obviously you would want a local-script to detect when you click the hot-bar, but how would you handle the attacks? Would you handle it with a server script, or a normal one inside of the client, or some kind of local script that executes the attack on the client, and then fires a remote event to the server to do everything to everyone else. This is the problem I had with my game ChemAttack!. I rushed into it, making all the perks and styles of the game, barely even finishing the actually game in itself. Just trying to make it look good.

Like I said before, it’s not like I don’t know ANYTHING about scripting, I know a thing or two, but I just want and need ideas from others about how to properly script a game. I can’t even fathom the effort it would take to make a game all by yourself, with GUIs, sound effects, and no obvious bugs. And even to actually fix the bugs, it seems like every time I MAKE a method to do anything, it works, but then it only works. It’s not suited to be updated or modified in any kind of way because I would have to change a BUNCH of other things in the game, and it’ll be a mess.

I always see other games, with all of these fancy GUIs and sounds and things, and I feel guilty because I don’t know how to do that, I can’t even script, or even come up with an idea of how to get something like that done.

TL;DR: How can I script more dynamically, and avoid bugs. Are there any common methods, or conventional process to actually developing a game?

Just give some examples?

1 Like

Bugs will happen to you no matter what the best thing to do is to never give up trying or at least know what cause the bug and avoid it.

Making games is hard, it doesn’t just need good scripting skills it also needs patience because bugs can make you don’t want to continue anymore. Don’t be upset that you didn’t make a game yet, be happy that you are trying to do so.

1 Like

Yes, I know. I understand it takes patience to script a game, I just don’t want to encounter bugs in the first place, so I just want to know the necessary precautions, and methods other scripter use to accomplish things.

Like for instance, making so that when a player touches a part, they become invisible, but the player can still see himself. How would I do that? One way you could do it is by, creating a local script that when fired, the specific player becomes invisible for everyone else, but nothing happens on the invisible client.

But how would I properly implement this? What if the player resets? Or does anything to mess it up? I want to know how to code more dynamically.

Don’t expect any script you do to work, it’s a matter of trail and error

Have you made any functional games?

I didn’t in fact if you check my roblox creations you will see only really bad games

Module scripts are useful things, in case you don’t use them already. You put code in them and refer to them from another script, which is good for reducing the copy pasting of large amounts of code in scripts.

2 Likes

Yes, I always want to incorporate module scripts in my code to make it easier and smoother. I want everything to be organized and complete.

Don’t underestimate the usage of modules, they’re really useful. I use them to counter the 200 variable limit, I also love programming OOP, it’s very perfect for a ‘framework’.
P.S: Framework is the equivalent of a computer client (Such as handling visual effects, input, etc)

By OOP you mean like really object oriented? Like java?

Yes, you can use OOP for modules dedicated to an aspect of the game; such as ragdolls, settings, gui, bullets, viewmodels, etc.

What do you mean by this? How would I do this?

What I mean is that OOP is used to organize code and structure, it’s also easy to use when you get the hang of it.

You can learn more about OOP in this thread.

Thank you! I appreciate the help.