TTT small issue

LINE 22
[lua] local num = RolePoints[killer:GetRole()][ply:GetRole()][/lua]

Did you check to see if ply and killer were valid before that line, in the function?

Sorry i’m not good with lua here’s the code
[lua]function NotifyPlayer(ply, killer)
local num = RolePoints[killer:GetRole()][ply:GetRole()][/lua]

also have this


[ERROR] .../terrortown/entities/weapons/weapon_ttt_knife/shared.lua:267: attempt to call global 'ValidEntity' (a nil value)
1. unknown - .../terrortown/entities/weapons/weapon_ttt_knife/shared.lua:267

[lua]function SWEP:OnRemove()
if CLIENT and IsValid(self.Owner) and self.Owner == LocalPlayer() and self.Owner:Alive() then // 267
RunConsoleCommand(“lastinv”)
end
end[/lua]

put one line above:
local num = RolePoints[killer:GetRole()][ply:GetRole()]
put:
if not IsValid(ply) or IsValid(killer) then return end

this will say if the person that was killed or if the killer is not valid them exit.