Anyone have a code for when you die in TTT you get this message in chat: "[Player name here] was killed by [Killer name here] [TTT Role here]" and it only appears for the player?
[lua]
hook.Add("PlayerDeath", "Who Killed You", function(vic, infl, att)
if (att:IsPlayer() && vic:IsPlayer()) then
vic:PrintMessage(HUD_PRINTTALK, "You were killed by "..att:Nick().." ["..att:GetRoleString().."!]")
end
end)
hook.Add("PlayerDeath", "Who You Killed", function(vic, infl, att)
if (att:IsPlayer() && vic:IsPlayer()) then
att:PrintMessage(HUD_PRINTTALK, "You killed "..vic:Nick().." ["..vic:GetRoleString().."]")
end
end)
[/lua]
Put this in lua/autorun/server/whosthekiller.lua
Why two hooks?
Why not?
(I did not make this, though it should work)
[editline]27th May 2013[/editline]
A much better code in [url]http://facepunch.com/showthread.php?t=1273527[/url]
Sorry, you need to Log In to post a reply to this thread.