Did you check to see if ply and killer were valid before that line, in the function?
[QUOTE=Pandaman09;39466106]Did you check to see if ply and killer were valid before that line, in the function?[/QUOTE]
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
[code][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[/code]
[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.
Sorry, you need to Log In to post a reply to this thread.