• Max armor?
    2 replies, posted
Ok if i do a code like this : [CODE]ply:SetArmor(ply:Armor() + 100) [/CODE] it will set the players health to current armor + 100 but the problem is if i example already have 200 armor and i use my points on this again it sets my armor to 45 because max armor in Source engine is 255. How can i prevent it to go over 255?
Do a check. [code]if ply:Armor() > 255 then etc etc end[/code]
[QUOTE=Nookyava;42563806]Do a check. [code]if ply:Armor() > 255 then etc etc end[/code][/QUOTE] Thanks i did this : [CODE] if ply:Armor() >= 155 then ply:SetArmor( 255 ) elseif ply:Armor() <= 154 then ply:SetArmor(ply:Armor() + 100)[/CODE]
Sorry, you need to Log In to post a reply to this thread.