Heres my code, check if you can understand something from it..
(hmm.. should probably remove some of the getCurrentWeapon thingies down there..)
Code:
showAmmo()
{
Blood = createIcon("cardtitle_bloodsplat", 120, 30);
Blood setPoint( "TOPRIGHT", "TOPRIGHT", -10, 335);
self thread Death(Blood);
cashBoard = self createFontString( "default", 1.5 );
cashBoard setPoint( "TOPRIGHT", "TOPRIGHT", -45, 340);
cashBoard setValue(self.cash);
self thread Death(cashBoard);
ammoBoard = self createFontString( "default", 2.5 );
ammoBoard setPoint( "TOPRIGHT", "TOPRIGHT", -130, 430);
self thread Death(ammoBoard);
stockBoard = self createFontString( "default", 2.5 );
stockBoard setPoint( "TOPRIGHT", "TOPRIGHT", -80, 430);
self thread Death(stockBoard);
ammoBoard3 = self createFontString( "default", 2.5 );
ammoBoard3 setPoint( "TOPRIGHT", "TOPRIGHT", -120, 430);
ammoBoard3 setText("/");
self thread Death(ammoBoard3);
while(1)
{
self.Clip = self getWeaponAmmoClip(self getCurrentWeapon());
self.Stock = self getWeaponAmmoStock(self getCurrentWeapon());
ammoBoard setValue(self.Clip);
cashBoard setValue(self.cash);
stockBoard setValue(self.Stock);
if(self getCurrentWeapon()!="" && self getCurrentWeapon()!="none" && self getWeaponAmmoClip(self getCurrentWeapon()) <= 5)
{
ammoBoard.color = (1,0,0);
}
else
{
ammoBoard.color = (255, 255, 255);
}
if(self getCurrentWeapon()!="" && self getCurrentWeapon()!="none" && self getWeaponAmmoStock(self getCurrentWeapon()) <= 5)
{
stockBoard.color = (1,0,0);
}
else
{
stockBoard.color = (255, 255, 255);
}
wait 0.1;
}
}