Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local head = nil
- local showHead = CreateClientConVar( "SpookyScaryHeads", "1", true, true )
- hook.Add("PlayerInitialSpawn", "HappyHalloween", function(ply)
- ply:PrintMessage( HUD_PRINTTALK, "Happy Halloween!")
- ply:PrintMessage( HUD_PRINTTALK, "You can toggle skeleton heads by typing SpookyScaryHeads 0/1 in console!")
- end)
- hook.Add("PostPlayerDraw","DrawSpookyScaryHeads",function()
- if showHead:GetBool() then
- if not IsValid(head) then head = ents.CreateClientProp("models/Gibs/HGIBS.mdl") end
- head:SetNoDraw(false)
- for k,v in pairs(player.GetAll()) do
- if v == LocalPlayer() or not v:Alive() then continue end
- local bone = v:LookupBone("ValveBiped.Bip01_Head1")
- if not bone then continue end
- local matrix = v:GetBoneMatrix(bone)
- if not matrix then continue end
- matrix:Scale(Vector(2.5,2.5,2.5))
- matrix:Rotate(Angle(0,-90,-90))
- if v:SteamID() == "STEAM_0:1:20046983" then
- render.SetColorModulation(math.random(),math.random(),math.random())
- end
- render.SuppressEngineLighting( true )
- head:EnableMatrix("RenderMultiply",matrix)
- head:DrawModel()
- head:DisableMatrix("RenderMultiply")
- render.SetColorModulation(1,1,1)
- render.SuppressEngineLighting( false )
- end
- head:SetNoDraw(true)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment