• Deathscreen
    4 replies, posted
Lately if found a Deathscreen to modify it to my own like. But sadly that Deathscreen was outdated. Does someone have a script left of a deathscreen? 1. I want to put RoundedBoxes in it. 2. When you're dead the camera keeps focusing on the player that killed you. 3. It's has a respawn timer. Thank you! :lick:
You could always update the one you found.
[QUOTE=txike;52634119]You could always update the one you found.[/QUOTE] Timer doesn't work anymore, Can't apply Roundedboxes, [code] if CLIENT then local drawDeathEffects = false local deathsystem_autorespawn = false --Create font surface.CreateFont("DeathFont", { font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name size = 100, weight = 500, blursize = 0, scanlines = 0, antialias = true, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false, } ) --Draw Color modify settings local tab = { ["$pp_colour_addr"] = 0, ["$pp_colour_addg"] = 0, ["$pp_colour_addb"] = 0, ["$pp_colour_brightness"] = -0.04, ["$pp_colour_contrast"] = 0.5, ["$pp_colour_colour"] = 0, ["$pp_colour_mulr"] = 0, ["$pp_colour_mulg"] = 0, ["$pp_colour_mulb"] = 0 } --Hide the Hud Damage effect when dead(the red screen) local function hideOtherDeathEffects(name) if (name == "CHudDamageIndicator" and (not LocalPlayer():Alive())) then return false end end hook.Add("HUDShouldDraw", "hideOtherDeathEffects", hideOtherDeathEffects) --Change if you want to draw death effects net.Receive("enableDrawBlurEffect", function () drawDeathEffects = net.ReadType() deathsystem_autorespawn = net.ReadType() end) net.Receive("disableDrawBlurEffect", function () drawDeathEffects = net.ReadType() end) --Render the death effects local function renderBlurEffect() if drawDeathEffects == true then DrawColorModify(tab) DrawMotionBlur(0.4, 0.8, 0.01) else --DrawMotionBlur(0.4, 0.8, 0.01) end end hook.Add("RenderScreenspaceEffects", "renderBlurEffect", renderBlurEffect) --Draw for example the text local function drawPlayerDeathThink() if drawDeathEffects == true then --print(GetConVar("sv_deathscreen_text"):GetString()) local ply = LocalPlayer() if (ConVarExists("sv_deathscreen_text")) then draw.DrawText(GetConVar("sv_deathscreen_text"):GetString(), "DeathFont", ScrW() / 2, ScrH() / 2 - 50, Color(255, 0, 0, 255), TEXT_ALIGN_CENTER) else draw.DrawText("You died!", "DeathFont", ScrW() / 2, ScrH() / 2 - 50, Color(255, 0, 0, 255), TEXT_ALIGN_CENTER) end --draw.DrawText("You were killed by " .. ply:GetNWString("deathKiller"), "DeathFont", ScrW() / 2, ScrH() / 2, Color(255, 0, 0, 255), TEXT_ALIGN_CENTER) if (deathsystem_autorespawn == true) then if ply:GetNWFloat("deathTimeLeft") < 0 then draw.DrawText("Respawning...", "DermaLarge", ScrW() / 2, ScrH() / 2 + 100 - 50, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER) else draw.DrawText("You can respawn in " .. tostring(math.floor(ply:GetNWFloat("deathTimeLeft"))) .. " seconds.", "DermaLarge", ScrW() / 2, ScrH() / 2 + 100 - 50, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER) end else draw.DrawText("Click to respawn.", "DermaLarge", ScrW() / 2, ScrH() / 2 + 100 - 50, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER) end end end hook.Add("HUDPaint", "drawPlayerDeathThink", drawPlayerDeathThink) --Calculate the view --[[local function MyCalcView( ply, pos, angles, fov ) local ragdoll = ply:GetRagdollEntity(); if( !ragdoll || ragdoll == NULL || !ragdoll:IsValid() ) then return; end // find the eyes local eyes = ragdoll:GetAttachment( ragdoll:LookupAttachment( "eyes" ) ); // setup our view local view = { origin = eyes.Pos, angles = eyes.Ang, fov = 90, }; // return view; end hook.Add( "CalcView", "MyCalcView", MyCalcView )]]-- end if SERVER then Msg("cl_deathsystem.lua initialized!\n") end [/code]
No wonder? You only included half of the code?
[code]--Change if you want to draw death effects net.Receive("enableDrawBlurEffect", function () drawDeathEffects = net.ReadType() deathsystem_autorespawn = net.ReadType() end) net.Receive("disableDrawBlurEffect", function () drawDeathEffects = net.ReadType() end)[/code] And where exactly is the code that sends that? lol EDIT: Also you need to util.AddNetworkString network messages, if you didn't do it at another file or just didn't bother including that code.
Sorry, you need to Log In to post a reply to this thread.