So I am trying to make a script where when you click the part it it chooses a number from 1 - 5 and applies that number to the Number Value and if the number chosen is 1 the part turn green but if it is equal to anything else it turns red.
if script.Parent.ClickDetector.MouseClick:Connect(game.Workspace.NumVal.Value == math.random(1,5)) then
if game.Workspace.NumVal.Value == 1 then
script.Parent.BrickColor = BrickColor.new ("Bright green")
else
script.Parent.BrickColor = BrickColor.new ("Bright red")
end
end
