Some script question

Is there a script like
If tux coins>500
then tux coins -500 ?
sorry im new
If tux coins>500
then tux coins -500 ?
sorry im new

Open source game community & development
http://forum.freegamedev.net/
sector.Tux.add_coins(amount);
if (sector.Tux.get_coins() > 50) {
sector.Tux.add_coins(-50);
sector.Tux.add_bonus("fireflower");
}