CapsAdmin

Untitled

May 9th, 2011
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.44 KB | None | 0 0
  1. if CLIENT then
  2.  
  3.     local moon = GetGlobalEntity("vagineer")
  4.     first = true
  5.  
  6.     hook.Add("PostDrawSkyBox", "draw test moon", function()
  7.         if moon:IsValid() then
  8.             if first then
  9.                 moon:SetNoDraw(true)
  10.                
  11.                 function moon:BuildBonePositions()
  12.                     for i=0, self:GetBoneCount() do
  13.                         local name = self:GetBoneName(i):lower()
  14.                        
  15.                         if name == "prp_helmet" then continue end
  16.                        
  17.                         if name == "bip_head" or name == "bip_neck"  then
  18.                             local matrix = self:GetBoneMatrix(i)
  19.                             if matrix then
  20.                                 matrix:Scale(Vector()*100)
  21.                                 self:SetBoneMatrix(i, matrix)
  22.                             end
  23.                         else
  24.                             local matrix = self:GetBoneMatrix(i)
  25.                             if matrix then
  26.                                 matrix:Scale(Vector()*0.001)
  27.                                 matrix:SetTranslation(self:GetPos())
  28.                                 self:SetBoneMatrix(i, matrix)
  29.                             end
  30.                         end
  31.                     end
  32.                 end
  33.                
  34.                 first = false
  35.             end
  36.            
  37.             local t = CurTime() * 10
  38.             moon:SetPos(LocalPlayer():GetPos() + Vector()*100)
  39.             moon:SetAngles(Angle(t, t, t))
  40.             moon:DrawModel()
  41.         end
  42.     end)
  43.    
  44. end
  45.  
  46. if SERVER then
  47.     for _, ent in pairs(ents.FindByModel("models/player/engineer.mdl")) do
  48.         ent:Remove()
  49.     end
  50.  
  51.     local ent = ents.Create("prop_dynamic")
  52.     ent:SetModel("models/player/engineer.mdl")
  53.     ent:SetPos(Vector(729.93017578125,1549.1125488281,-13127.432617188) )
  54.     ent:Spawn()
  55.    
  56.     for i=0, ent:GetFlexNum() do
  57.         ent:SetFlexWeight(i, math.random()*0.4)
  58.     end
  59.    
  60.     SetGlobalEntity("vagineer", ent)
  61. end
Advertisement
Add Comment
Please, Sign In to add comment