You are not referencing the correct parts, there is no part in the workspace called “material”.
local function onTouch()
workspace.Part.Material = "Neon"
end
workspace.Part.Touched:Connect(onTouch)
You don’t need the local before the function!
1 Like
This is inefficient, use Enum
local function pro()
workspace.Part.Material = Enum.Material.Sand
end
local function omg()
workspace.Part2.Material = Enum.Material.Neon
end
workspace.Part.Touched:Connect(pro)
workspace.Part2.Touched:Connect(omg)
Also, to OP - please don’t send screenshots of your code. It’s so much harder to help you if we have to rewrite it rather than just copy and pasting.
1 Like
Thank you so much it works