• Health boost help
    3 replies, posted
[CODE] local ranks = { "superadmin", "admin", "vip" } local boost = 10 function HealthBoost( ply ) if table.HasValue( ranks, ply:GetUserGroup() ) then ply:SetHealth( ply:Health() + boost ) end end hook.Add( "PlayerSpawn", "Health_Boost", HealthBoost )[/CODE] Hi i was wondering how to do like a boost health fore evrey level fore my level system like. level = 1 boost 30 health level = 2 boost 30 health Like a table whear i can set how mutch health the get more any ides. I know my english sucks.
[lua]local HealthBoost = { -- {Level, Boost} -- {1, 10}, {2, 20}, {3, 30}, {4, 40} } function CheckHealthBoost( ply ) for k,v in pairs( HealthBoost ) do if v[1] = ply.Level then ply:SetHealth( ply:Health() + v[2] ) end end end hook.Add( "PlayerSpawn", "HealthBoost", CheckHealthBoost )[/lua] Where ply.Level would be how you store the level number.
Got it working
[QUOTE=gaminghunters;44587844]noting[/QUOTE] That's not really helpful. if you want our help, then at least bother to write more than 1 word and describe what's wrong.
Sorry, you need to Log In to post a reply to this thread.