Ok, so I have a script and I know it says that when you click it makes a random color as shown below,
script.Parent.ClickDetector.MouseClick:Connect(function() script.Parent.BrickColor = BrickColor.Random() end)
but I have tried to findle around with it and try to make it to a three specific colors which are, Carnation pink, Mint, and Pine cone. I also want to try to fit it into one whole script, but that makes it more complex for me to work with settings as a new scripter.
Hey there for starters we are going to create a table of the specific colours that we need:
local Colors = {BrickColor.new("Bright red"),BrickColor.new("Black"),BrickColor.new("Pink")}
So we have our table set now we just need to make it so when the player clicks on our part it will change colour!
script.Parent.ClickDetector.MouseClick:Connect(function() local RandomisedResult = Colors[math.random(1,#Colors)] script.Parent.BrickColor = RandomisedResult end)
So I assume you know how connecting an event to a function works so i'll leave that as something you already know!.
So abit of context of how this code works the variable RandomisedResult uses the math.random() function and goes from 1 to the end value of the table in this case "Pink"