game["death_headshot"], that is wrong.You can not make up a variable, and expect it to work automatically. The one you invented is not even linked to a specific player. This is a one-for-all variable.You need a variable like the one for the kill streak (self.pers["conseckill"])... personalized. A variable that is incremented, decremented, or reset when necessary.You are still running v1.6 I think, so you have two options to replace your invalid var:1. Keep track of headshot deathsself.pers["headshotdeath"]2. Keep track of headshot killsself.pers["headshotkill"]
init(){ precacheShader("death_headshot"); <--- precache level thread onPlayerConnect(); }onPlayerConnect(){ for(;;) { level waittill("connecting", player); player thread onJoinedTeam(); player thread onJoinedSpectators(); player thread onPlayerKilled(); player thread onPlayerSpawned(); }}onJoinedTeam(){ self endon("disconnect"); for(;;) { self waittill("joined_team"); self thread removeHeadshotsHUD(); }}onJoinedSpectators(){ self endon("disconnect"); for(;;) { self waittill("joined_spectators"); self thread removeHeadshotsHUD(); }}onPlayerKilled(){ self endon("disconnect"); for(;;) { self waittill("killed_player"); }}onPlayerSpawned(){ self endon("disconnect"); for(;;) { self waittill("spawned_player"); self thread showHeadshotsHUD(); self thread onPlayerScore(); }}onPlayerScore(){ self endon("disconnect"); for(;;) { self waittill("update_playerscore_hud"); self thread updateHeadshotsHUD(); }}showHeadshotsHUD(){ if(!isDefined(self.pers["headshotkill"])) self.pers["headshotkill"] = 0; if(!isdefined(self.hud_headshots)) {self.hud_headshots = newClientHudElem(self);self.hud_headshots.archived = false;self.hud_headshots.horzAlign = "left";self.hud_headshots.vertAlign = "top";self.hud_headshots.x = 16;self.hud_headshots.y = 80;self.hud_headshots.sort = 1;self.hud_headshots.alpha = 1;self.hud_headshots.fontscale = 1;self.hud_headshots.archived = false;self.hud_headshots.color = (1, 1, 1); self.hud_headshots setShader("death_headshot", 32, 32); <--- ]dont works :( but why? }self.hud_headshots setValue(self.pers["headshotkill"]);}updateHeadshotsHUD(){ if(isDefined(self.hud_headshots)) self.hud_headshots setValue(self.pers["headshotkill"]);}removeHeadshotsHUD(){ if(isdefined(self.hud_headshots)) self.hud_headshots destroy();}
If death_headshot is a proper shader ...