I am yet again stumped smile

I have a string to show total credits on a text panel

Code:
string credit = 10000;

text credit_txt
{
	pos_x = 774;
	pos_y = 305;
	layer = 2;
	font lcars2_font;
	string = credit;
	layer = 1;
}


So far so good, it shows up were i want smile

However when i select a ship i need that to go down so i did the following.

Code:
var credits = 10000;

function tile_event() 
{
	if (bmapno ==1) 
	{
	credits = - 2000;
	ent_create(ship_b1, my.x, ship_function);  // create / place ship at my.x?
	}
	if (bmapno ==2)
	{
	ent_create(ship_b2, my.x, ship_function);  // create / place ship at my.x?
	}
	if (bmapno ==3)
	{
	ent_create(ship_b3, my.x, ship_function);  // create / place ship at my.x?
	}
}


Now i have tried to change credits to the string credits_txt but get a read only error.
I am stuck as i cannot figure out how to get that 10g number to go down frown


Why does everyone like dolphins? Never trust a species which smiles all the time!