Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MyLegs(ply, hitgroup, dmginfo)
- if hitgroup == HITGROUP_RIGHTLEG or hitgroup==HITGROUP_LEFTLEG then
- dmginfo:ScaleDamage(2)
- if !ply.lboldwalkspeed then
- ply.lboldwalkspeed=ply:GetWalkSpeed()
- ply.lboldrunspeed=ply:GetRunSpeed()
- end
- ply:SetWalkSpeed(100)
- ply:SetRunSpeed(150)
- ply.LegsDamaged=true
- ply:SendHint( "You have broken your legs", 1)
- if string.find(ply:GetModel(), 'female') then
- ply:EmitSound('vo/npc/female01/myleg01.wav') else
- ply:EmitSound('vo/npc/male01/myleg01.wav')
- end
- elseif hitgroup==HITGROUP_STOMACH then
- if string.find(ply:GetModel(), 'female') then
- ply:EmitSound('vo/npc/female01/mygut02.wav')
- else
- ply:EmitSound('vo/npc/male01/mygut02.wav')
- end
- end
- end
- hook.Add("ScalePlayerDamage", "scaleplayerDamage", MyLegs)
- local nextCheck=0
- hook.Add('Think', 'fixLegs', function()
- if CurTime()>nextCheck then
- for f, v in pairs(player.GetAll()) do
- if v.LegsDamaged then
- if v:Health()>=100 then
- v:SetWalkSpeed(v.lboldwalkspeed)
- v:SetRunSpeed(v.lboldrunspeed)
- v.LegsDamaged=false
- v.lboldwalkspeed=nil
- v.lboldrunspeed=nil
- end
- end
- end
- nextCheck=CurTime()+1
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment