-
What do you want to achieve? I want to make an off button that deletes the children of a specific part and change the material and color.
-
What is the issue? The code only works up to the :ClearAllChildren() part.
-
What solutions have you tried so far? Since the material of the part was neon and I wanted it to turn black, I tried to change the part’s material to metal. Also tried putting that part of code above the :ClearAllChildren() part of the script.
I put so many .Parent because the script was in a click detector, in a part, in a folder and after that is a model.
script.Parent.MouseClick:Connect(function()
local light = script.Parent.Parent.Parent.Parent:WaitForChild("Light")
light:ClearAllChildren()
light.BrickColor = "Black"
end)
Sorry if I wasted your time I’m still learning how to script