Are my scripts good

Hello! I’m learning scripting right now, and i made test place with cakes!

I want to know, is my coding good or can i improve it!

game: cake test - Roblox (Uncopylocked)

thanks for any answers ᅠ:D

I checked your game, and these are my initial thoughts on what you made to script so far:

1.) “speed” in StarterPlayer > StarterCharacterScripts is pointless. You do not need to do this through a script as you should alter the CharacterWalkSpeed under the properties of StarterPlayer.

2.) I noticed a number of regular scripts on your client side (Specifically StarterGui and StarterCharacterScripts). The scripts contained here should be local scripts. This area is reserved for client-side code hence you need to practice the ability to pass data from the client to the server and vice versa (Best example is the cake!!!)

3.) cake!!! in StarterCharacterScripts doesn’t belong there in my opinion. Better yet a lot of restructuring to the code would be advised. This is something that works better and safer in the Server side (ServerScriptService), but there is also the approach of Client-Server where client can check if the player touches a cake and the server verifies if what the player touches is indeed the cake [This will involve Remotes].

4.) I personally don’t think that having a script in each cake that will rotate the cake object is practical (Especially when there are 24 cakes here and potentially more). I would personally approach this with OOP, but the concept especially for beginners can be very complex to grasp. I guess for starters I would highly recommend just having 1 rotate script, look into for loops (Essentially learning to get the children or contents of everything in a folder aka “:GetChildren()” ) and use that to execute your cake rotation for each object.

I can tell the project is very early on. It has a long way to go but it’s good that you’re getting insights into your approaches to your game. There’s nothing wrong with initial code looking this bare sometimes as long as you’re able to continuously work on enhancing and optimizing the code, essentially creating a stable foundation for you to work off. I may have overlooked some codes maybe but I hope my insights are able to help you determine what direction you would want to take next.

1 Like