Help with GUI and Trigonometry

It returns the error:
invalid argument #3 to 'clamp' (max must be greater than or equal to min)

would i just switch the min and max around in the clamp?