MCiLuZiioNz

Untitled

Feb 14th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. local head = nil
  2. local showHead = CreateClientConVar( "SpookyScaryHeads", "1", true, true )
  3.  
  4. hook.Add("PlayerInitialSpawn", "HappyHalloween", function(ply)
  5.         ply:PrintMessage( HUD_PRINTTALK, "Happy Halloween!")
  6.         ply:PrintMessage( HUD_PRINTTALK, "You can toggle skeleton heads by typing SpookyScaryHeads 0/1 in console!")
  7. end)
  8.  
  9. hook.Add("PostPlayerDraw","DrawSpookyScaryHeads",function()
  10.   if showHead:GetBool() then
  11.   if not IsValid(head) then head = ents.CreateClientProp("models/Gibs/HGIBS.mdl") end
  12.   head:SetNoDraw(false)
  13.   for k,v in pairs(player.GetAll()) do
  14.     if v == LocalPlayer() or not v:Alive() then continue end
  15.     local bone = v:LookupBone("ValveBiped.Bip01_Head1")
  16.     if not bone then continue end
  17.     local matrix = v:GetBoneMatrix(bone)
  18.     if not matrix then continue end
  19.       matrix:Scale(Vector(2.5,2.5,2.5))
  20.       matrix:Rotate(Angle(0,-90,-90))
  21.     if v:SteamID() == "STEAM_0:1:20046983" then
  22.       render.SetColorModulation(math.random(),math.random(),math.random())
  23.     end
  24.     render.SuppressEngineLighting( true )
  25.     head:EnableMatrix("RenderMultiply",matrix)
  26.       head:DrawModel()
  27.     head:DisableMatrix("RenderMultiply")
  28.     render.SetColorModulation(1,1,1)
  29.     render.SuppressEngineLighting( false )
  30.   end
  31.   head:SetNoDraw(true)
  32.   end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment