✓ Accepted answer
Hello.
There are a few errors you have made with your script. The very first error, is that you have used the wrong Click function for the ClickDetector. ClickDetectors use MouseClick instead of MouseButton1Click. Second error in your script is that you aren't getting the Part's colour correctly, and it should be done with a BrickColor.new("Lime green") instead. Make sure that Lime Green is spelt exactly as Lime green or else it won't work. The syntax should already fill it in for you when typing this.
So, now that we have gone through the errors of the script, we can apply these changes, and make this system work.
Click script (ServerScript)
local ClickDetector = script.Parent
local Part = ClickDetector.Parent
ClickDetector.MouseClick:Connect(function()
if Part.BrickColor == BrickColor.new("Lime green") then
Part.BrickColor = BrickColor.new("Really red")
else
Part.BrickColor = BrickColor.new("Lime green")
end
end)
Hope this helps!
1 comment
Why did you ignore this good answer?