So I found this file when digging back through my backups from years ago and it’s a script that gives points when a t kills an Innocent ect. The issue I found with it is that, it displays the points for the kill after the kills happened, how would I go around delaying/hooking the message and points till the round end?
hook.Add("Initialize", "Points.Initialize", function()
if !ROLE_INNOCENT then return end
local RolePoints = {
[ROLE_DETECTIVE] = {
[ROLE_DETECTIVE] = 0,
[ROLE_INNOCENT] = 0,
[ROLE_TRAITOR] = 50
},
[ROLE_INNOCENT] = {
[ROLE_DETECTIVE] = 0,
[ROLE_INNOCENT] = 0,
[ROLE_TRAITOR] = 80
},
[ROLE_TRAITOR] = {
[ROLE_DETECTIVE] = 50,
[ROLE_INNOCENT] = 25,
[ROLE_TRAITOR] = 0
}
}
local function NotifyPlayer(ply, killer)
local num = RolePoints[killer:GetRole()][ply:GetRole()]
local bool = string.find(num, "-")
if bool then
killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You had "..num.." points taken away for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".")
else
killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were awarded "..num.." points for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".")
end
killer:PS_GivePoints(num)
end
hook.Add("DoPla
yerDeath", “PS.GivePointsOnDeath”, function(ply, killer, dmginfo)
if !IsValid(killer) or !killer:IsPlayer() or !IsValid(ply) or !ply:IsPlayer() or (ply == killer) or !ply:Alive() then return end
if GetRoundState() == ROUND_ACTIVE then
NotifyPlayer(ply, killer)
end
end)
end)