So im making a really basic script (hard for me bc im new) but it doesnt seem to turn the di green when It touches the brick heres the script
local Dice1 = game.Workspace.Dice1 local Dice2 = game.Workspace.Dice2 script.Parent.Touched:Connect(function(hit) if hit.parent:FindFirstChild("Dice1") then Dice1.BrickColor = BrickColor.new('Sage green') end end)
hit.parent:FindFirstChild("Dice1")
is incorrect. You should be using Parent
. also, if you only want dice1 to become green after being touched, you should do
hit == Dice1
as otherwise it will affect every part that is a direct child of the workspace, because hit.Parent
in this context is the Workspace, and the Workspace will always have the Dice1 descendant