Advertisement
HK47

fix

Nov 7th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.03 KB | None | 0 0
  1. if CLIENT then
  2.     local function add_wf(data)
  3.         local ply = data:ReadEntity()
  4.         local model = data:ReadString()
  5.         local pos = data:ReadVector()
  6.        
  7.         if ply.clientm and ply.clientm:IsValid() then ply.clientm:Remove() end
  8.         ply.clientm = ClientsideModel(model)
  9.        
  10.         if not ply.clientm and not ply.clientm:IsValid() then return end
  11.         local cache_model = ply.clientm
  12.        
  13.         ply.clientm:SetPos(pos)
  14.         ply.clientm:SetSequence(ply:GetSequence())
  15.         ply.clientm:SetModelScale(1.2, 0)
  16.         ply.clientm:SetRenderMode(RENDERMODE_TRANSALPHA)
  17.         ply.clientm:SetMaterial("models/vortigaunt/pupil")
  18.        
  19.         local a = 255
  20.        
  21.         hook.Add("Think", "remove_wireframe_tws" .. ply:EntIndex(), function()
  22.             if not ply:IsValid() then
  23.                 if cache_model and cache_model:IsValid() then cache_model:Remove() end
  24.                 hook.Remove("Think", "remove_wireframe_tws" .. ply:EntIndex())
  25.             end
  26.        
  27.             if ply.clientm and ply.clientm:IsValid() then
  28.                 if a <= 0 then ply.clientm:Remove() hook.Remove("Think", "remove_wireframe_tws" .. ply:EntIndex()) return end
  29.            
  30.                 a = a - 0.5
  31.                 ply.clientm:SetColor(Color(255, 255, 255, a))
  32.                 ply.clientm:SetAngles(Angle(0, CurTime() * 150, 0))
  33.             end
  34.         end)
  35.     end
  36.    
  37.     usermessage.Hook("make_wireframe_tws", add_wf)
  38.  
  39.     return
  40. end
  41.  
  42. hook.Add("PlayerSpawn", "tws_spawnprotect", function(ply)
  43.     if CLIENT then return end
  44.    
  45.     ply:GodEnable()
  46.    
  47.     local model = ply:GetModel()
  48.     local pos = ply:GetPos()
  49.    
  50.     umsg.Start("make_wireframe_tws")
  51.         umsg.Entity(ply)
  52.         umsg.String(model)
  53.         umsg.Vector(pos)
  54.     umsg.End()
  55.    
  56.     timer.Simple(6, function()
  57.         if IsValid(ply) then
  58.             ply:GodDisable()
  59.         end
  60.     end)
  61. end)
  62.  
  63. //blocker
  64.  
  65. hook.Add("PlayerSpawnSENT", "blocker_tws", function(ply, class)
  66.     if class == "sent_ball" then return false end
  67.     return true
  68. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement