local button=script.Parent local frame=button.Parent button.MouseButton1Click:connect(function() print("clicked") frame.BackgroundColor3=Color3.new(math.random(0, 255),math.random(0, 255),math.random(0, 255)) end)
Color3.new()
ranges from 0 to 1. You have to divide the R, G and B by 255 or use the range 0 to 1;
game.StarterGui.ScreenGui.Frame.BackgroundColor3 = Color3.new( math.random(), math.random(), math.random() )
The parameters to Color3.new
are actually between 0 and 1, not 0 and 255 (as you might guess from the Properties tab).
As a result, you should use numbers from 0 to 1 instead of 0 to 255:
frame.BackgroundColor3 = Color3.new(math.random(), math.random(), math.random())