Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // you can stop using your shitty "KILLSTREAK = 3" scripts now
- local function contraction(num)
- num = tostring(num);
- local contract = string.sub(num, string.len(num), string.len(num));
- local cont = "";
- if (string.len(num) > 1) then
- if (string.GetChar(num, string.len(num) - 1) == "1") then // 11, 12, 13, 111, 112, ...
- return num .. "th";
- end
- end
- if contract == "1" then
- cont = "st";
- elseif contract == "2" then
- cont = "nd";
- elseif contract == "3" then
- cont = "rd";
- else // 0 4 5 6 7 8 9
- cont = "th";
- end
- return num .. cont;
- end
- local sayings = {
- "First Blood!",
- "Killing Spree!",
- "Killing Frenzy!",
- "Running Riot!",
- "Rampage!",
- "Untouchable!",
- "Invincible!"
- }
- local function getmsg(knum)
- if (knum <= 1) then
- return sayings[1];
- elseif (knum <= 10) then
- return sayings[2];
- elseif (knum <= 15) then
- return sayings[3];
- elseif (knum <= 20) then
- return sayings[4];
- elseif (knum <= 25) then
- return sayings[5];
- elseif (knum <= 30) then
- return sayings[6];
- else
- return sayings[7];
- end
- end
- local kills = 0;
- local function killstreak(data)
- local attacker = player.GetByID(data.entindex_attacker);
- local victim = player.GetByID(data.entindex_killed);
- if (!attacker:IsValid() or !victim:IsValid()) then
- return;
- end
- if (victim == LocalPlayer()) then // streak over
- kills = 0;
- return;
- end
- if (attacker == LocalPlayer()) then
- kills = kills + 1;
- RunConsoleCommand("say", string.format("%s %s was my %s kill!", getmsg(kills), victim:Nick(), contraction(kills)));
- end
- end
- gameevent.Listen("entity_killed");
- hook.Add("entity_killed", "killstreak", killstreak);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement