Looking for Feedback on First Scripted Project

Two days ago I decided I wanted to pick up scripting, and so I’ve been trying to teach myself some stuff via Youtube and Devforum! I was wondering if I could get some feedback on my first scripted piece!

Game Link: Petal's Scripts - Roblox

My goal was that when stepping on the grey plot, the entirety of it gains color and material. I think it works nicely, but I was looking for any feedback on script issues, or possibly suggestions for what else could be added!

Also, if anybody knows any excellent discussions or videos regarding beginner scripting resources, I would be most appreciative!

Much Thanks,
-PetalPotions

1 Like

Well, it’s tough to give feedback without having the source code accessible.

I’m not sure if it’s the best source code, or over complicated source code, or mediocre source code. Why not upload the script or paste some key parts as text?

1 Like

I agree, It’s good your teaching urself to script though

1 Like

Oh right! Thank you for reminding me! This is my main code:

local Grass = game.Workspace.Grass
local Fence = game.Workspace.Fence
local Bricks = game.Workspace.Bricks
local Roof = game.Workspace.Roof
local House = game.Workspace.HouseMain
local Frame = game.Workspace.Frame
local Door = game.Workspace.Door2
local Window = game.Workspace.Window
local WindowFrame = game.Workspace.WindowFrame

local function Grassy()
Grass.Material = Enum.Material.Grass
Grass.Color = Color3.fromRGB(188, 236, 168)

Fence.Material = Enum.Material.WoodPlanks
Fence.Color = Color3.fromRGB(255, 255, 255)

Bricks.Material = Enum.Material.Concrete
Bricks.Color = Color3.fromRGB(231, 208, 171)

Roof.Material = Enum.Material.Concrete
Roof.Color = Color3.fromRGB(231, 208, 171)

House.Material = Enum.Material.Concrete
House.Color = Color3.fromRGB(255, 220, 226)

Frame.Material = Enum.Material.WoodPlanks
Frame.Color = Color3.fromRGB(213, 166, 150)

Door.Material = Enum.Material.WoodPlanks
Door.Color = Color3.fromRGB(172, 125, 116)

Window.Material = Enum.Material.Glass
Window.Color = Color3.fromRGB(58, 74, 111)

WindowFrame.Material = Enum.Material.WoodPlanks
WindowFrame.Color = Color3.fromRGB(213, 166, 150)

end

game.Workspace.Grass.Touched:Connect(Grassy)


And then I have a separate code that, when a player steps off of the grass plot, activates a similar function, which causes all the parts to turn back to the original color and plastic material. I’ve been looking into way I can maybe mainstream this, as it seems a little messy to have two scripts, are there features that could allow me to achieve these actions under one script?

1 Like

Okay! This code is excellent for a beginner. Search up alvinblox and find his scripting videos, they are really helpful!

1 Like

Yup, the code looks great for its purpose.

1 Like

Thank you very much!

I have been enjoying his tutorials! So far I’ve been watching a lot of his videos, as well as TheDevKing’s scripting series!

Okay! Thank you so much, definitely means a lot! :slight_smile:

1 Like

I’d recommend looking into how Region3 works if you wanna convert this into a full on singular script, as it takes the specific Region of the world space (Or let’s say an invisible part) and you can do something with it (Like changing the colors of the grass plot)

For your first scripted project itself, this is really well done! I congratulate you for this! :slightly_smiling_face:

1 Like

Very clean script, ur doing a good job.

But here’s one problem, what if a baseplate touches the part? So this is why you may have to do this:

game.Workspace.Grass.Touched:Connect(function(hit) -- detects if a part is touched and gets what hit it.
local hum = hit.Parent:FindFirstChildWhichIsA("Humanoid") -- searches through the hit's parent and looks if it has a humanoid
if hum then -- if it does have a humanoid
Grassy() -- call the function
end
end)
1 Like

Oh thank you so much! I’ll definitely read up on that, it sounds super helpful! :slightly_smiling_face:

1 Like

Ah thank you for this! I initially had some flowers that were to pop out of the ground, but they kept messing up the color/material script because they were touching the plot! This is super helpful, thank you very much! :grin:

Suggest you learn the basics before heading to Regions

1 Like

That’s likely best! I’m still making my way through some beginner scripting series, so maybe once I finish those these newer concepts will make more sense to me!

I’m also learning myself, im also learning from free models and scripter teacher aswell that is cheap for his services. Your doing so good for beinggner as I’m also learner myself so I also read through scripts and look in devform. Well done :smile:

1 Like