Advertisement
HK47

asdasd

Oct 26th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.83 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.        
  9.         ply.clientm = ClientsideModel(model)
  10.        
  11.         if not ply.clientm:IsValid() then return end
  12.        
  13.         ply.clientm:SetPos(pos)
  14.         ply.clientm:SetSequence(1)
  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 hook.Remove("Think", "remove_wireframe_tws" .. ply:EntIndex()) end
  23.        
  24.             if ply.clientm and ply.clientm:IsValid() then
  25.                 if a <= 0 then ply.clientm:Remove() hook.Remove("Think", "remove_wireframe_tws" .. ply:EntIndex()) return end
  26.            
  27.                 a = a - 0.5
  28.                 ply.clientm:SetColor(Color(255, 255, 255, a))
  29.                 ply.clientm:SetAngles(Angle(0, CurTime() * 150, 0))
  30.             end
  31.         end)
  32.     end
  33.    
  34.     usermessage.Hook("make_wireframe_tws", add_wf)
  35.  
  36.     return
  37. end
  38.  
  39. hook.Add("PlayerSpawn", "tws_spawnprotect", function(ply)
  40.     if CLIENT then return end
  41.  
  42.     ply:GodEnable()
  43.    
  44.     local model = ply:GetModel()
  45.     local pos = ply:GetPos()
  46.    
  47.     umsg.Start("make_wireframe_tws")
  48.         umsg.Entity(ply)
  49.         umsg.String(model)
  50.         umsg.Vector(pos)
  51.     umsg.End()
  52.    
  53.     timer.Simple(5, function()
  54.         if IsValid(ply) then
  55.             ply:GodDisable()
  56.         end
  57.     end)
  58. end)
  59.  
  60. //blocker
  61.  
  62. hook.Add("PlayerSpawnSENT", "blocker_tws", function(ply, class)
  63.     if class == "sent_ball" then return false end
  64.     return true
  65. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement