shadowndacorner

bm

Oct 20th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.59 KB | None | 0 0
  1.     hook.Add("OnEntityCreated", "correctStalkersClientside", function(ent)
  2.         if (ent.IsZombie and ent:IsZombie()) or ent:GetClass()=="npc_zombie_torso" or ent:GetClass()=="npc_sstalker" or ent:GetClass()=="npc_poisonzombie" or ent:GetClass()=="npc_zombie" or ent:GetClass()=="npc_fastzombie" then
  3.             ent.CharacterModels={
  4.                 "models/Humans/Group01/Female_01.mdl",
  5.                 "models/Humans/Group01/Female_02.mdl",
  6.                 "models/Humans/Group01/Female_03.mdl",
  7.                 "models/Humans/Group01/Female_04.mdl",
  8.                 "models/Humans/Group01/Female_06.mdl",
  9.                 "models/Humans/Group01/Female_07.mdl",
  10.                 "models/Humans/group01/male_01.mdl",
  11.                 "models/Humans/Group01/Male_02.mdl",
  12.                 "models/Humans/Group01/male_03.mdl",
  13.                 "models/Humans/Group01/Male_04.mdl",
  14.                 "models/Humans/Group01/Male_05.mdl",
  15.                 "models/Humans/Group01/Male_06.mdl",
  16.                 "models/Humans/Group01/Male_07.mdl",
  17.                 "models/Humans/Group01/Male_08.mdl",
  18.                 "models/Humans/Group01/Male_09.mdl"
  19.             }
  20.            
  21.             ent:CallOnRemove("getRidOfclientModel", function(self)
  22.                 if IsValid(self.ModelToDraw) then
  23.                     self.ModelToDraw:Remove()
  24.                 end
  25.             end)
  26.            
  27.             ent.RenderOverride=function(self)
  28.                 self:DrawModel()
  29.                 self:SetMaterial("engine/occlusionproxy")
  30.                 if !IsValid(self.ModelToDraw) then
  31.                     self.VirtualModel=self.VirtualModel or table.Random(self.CharacterModels)
  32.                     self.ModelToDraw=ClientsideModel(self.VirtualModel)
  33.                     self.ModelToDraw:SetParent(self)
  34.                     self.ModelToDraw:AddEffects(bit.bor(EF_BONEMERGE, EF_PARENT_ANIMATES))
  35.                 end
  36.                 //self.ModelToDraw:RemoveEffects(bit.bor(EF_BONEMERGE, EF_PARENT_ANIMATES))
  37.                 if string.find(self:GetClass(), "torso") then
  38.                     local bonesToHide={
  39.                         "ValveBiped.Bip01_Pelvis",
  40.                         "ValveBiped.Bip01_R_Thigh",
  41.                         "ValveBiped.Bip01_L_Thigh",
  42.                         "ValveBiped.Bip01_R_Calf",
  43.                         "ValveBiped.Bip01_L_Calf",
  44.                         "ValveBiped.Bip01_R_Foot",
  45.                         "ValveBiped.Bip01_L_Foot",
  46.                         "ValveBiped.Bip01_R_Toe0",
  47.                         "ValveBiped.Bip01_L_Toe0",
  48.                     }
  49.                     for f, v in pairs(bonesToHide) do
  50.                         self.ModelToDraw:ManipulateBoneScale(self.ModelToDraw:LookupBone(v), Vector(0.000001, 0.000001, 0.000001))
  51.                         self.ModelToDraw:ManipulateBonePosition(self.ModelToDraw:LookupBone(v), Vector(0, 0, -30))
  52.                     end
  53.                     if self.ModelToDraw:LookupBone("ValveBiped.Bip01_Hips") then
  54.                         //self.ModelToDraw:ManipulateBonePosition(self.ModelToDraw:LookupBone("ValveBiped.Bip01_Hips"), Vector(0, 0, -30))
  55.                     end
  56.                 end
  57.                 self.ModelToDraw:SetParent(self)
  58.                 self.ModelToDraw:SetPos(self:GetPos())
  59.                 self.ModelToDraw:SetAngles(self:GetAngles())
  60.             end
  61.             print('setting')
  62.         end
  63.     end)
Advertisement
Add Comment
Please, Sign In to add comment