• Body Armor?
    10 replies, posted
Hello Im workin on adding a body armor thing to my gamemode. Basically the player has a certain level and based on that level he gets a damage reduction percentage. I was looking for some insight on how to perform this. I know im gonna be using ScaleDamage() but how would i properly do that? Would the Hitgroup be HITGROUP_GENERIC???
[code]player._ScaleDamage = 0.5;[/code] Possibly wont work; it's from the cider item; Kevlar.
[QUOTE=Busymonkey;23721153][code]player._ScaleDamage = 0.5;[/code] Possibly wont work; it's from the cider item; Kevlar.[/QUOTE] Nope
Here you go: [b][url=http://wiki.garrysmod.com/?title=Player.SetArmor]Player.SetArmor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] [b][url=http://wiki.garrysmod.com/?title=Player.Armor]Player.Armor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
[QUOTE=goluch;23727044]Here you go: [b][url=http://wiki.garrysmod.com/?title=Player.SetArmor]Player.SetArmor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] [b][url=http://wiki.garrysmod.com/?title=Player.Armor]Player.Armor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b][/QUOTE] Not what he's asking for. He want the player to recieve half of the damage.
Its in the ScalePlayerDamage hook
im messin with this now [CODE] function GM:ScalePlayerDamage(ply,hitgroup,dmginfo) dmginfo:ScaleDamage(.50) end [/CODE] No luck though
just give them more armor if they are of a higher rank? same thing really
i sorta wanted to scale the damage like at level 1 you get 5 percent reduction and so on.
[lua] dmginfo:ScaleDamage( 0.5 ) [/lua] nothing wrong with that code at all, dont know why it wouldnt work :S
NVM [QUOTE] function GM:ScalePlayerDamage(ply,hitgroup,dmginfo) dmginfo:ScaleDamage(.50) end [/QUOTE] this works fine :)
Sorry, you need to Log In to post a reply to this thread.