So, whenever I am T and I get the knife myself, I am perfectly fine. My issue is with the secret knife found on community bowling and community pool. Basically, as a T, Inno, or Detective, I pick up the secret knife. I run around for a bit, but when I actually take out the knife, it get lua errors and get kicked for too many lua errors. Here is the error it claims:
[CODE]You have 5 seconds to get the knife
The secret knife has been found!
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284: attempt to call method 'GetEyeTrace' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_knife/shared.lua:284
[/CODE]
Here is a copy of my shared.lua:
[CODE]
if SERVER then
AddCSLuaFile( "shared.lua" )
end
SWEP.HoldType = "knife"
if CLIENT then
SWEP.PrintName = "knife_name"
SWEP.Slot = 6
You probably touched something and broke it. Heres the most up to date code for the knife. [URL="https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/weapons/weapon_ttt_knife.lua"]link[/URL]
I would also check and make sure your ttt is updated to the latest version which you can find [URL="https://github.com/garrynewman/garrysmod"]here[/URL].
I never touched anything. I downloaded both things you linked and it is still kicking me for lua errors
Shit, if its that much of an emergency, try removing the entire DrawHUD function and just do without it if it makes the game unplayable.
Also, can someone who is an expert explain what the argument is doing in:[CODE]local tr = self.Owner:GetEyeTrace(MASK_SHOT)[/CODE] I have never seen that function with an argument before, and I would think it was the problem if he hadn't said he didnt touch it. I dont want to say "get rid of it and see what happens" but thats totally what I would do.
Actually, looking at it now, that isn't the line I pointed out at the end of the main post that has an error, however, this is the entire issue:
[QUOTE]if CLIENT then
function SWEP:DrawHUD()
local tr = self.Owner:GetEyeTrace(MASK_SHOT)
if tr.HitNonWorld and IsValid(tr.Entity) and tr.Entity:IsPlayer()
and tr.Entity:Health() < (self.Primary.Damage + 10) then
local x = ScrW() / 2.0
local y = ScrH() / 2.0
surface.SetDrawColor(255, 0, 0, 255)
local outer = 20
local inner = 10
surface.DrawLine(x - outer, y - outer, x - inner, y - inner)
surface.DrawLine(x + outer, y + outer, x + inner, y + inner)
surface.DrawLine(x - outer, y + outer, x - inner, y + inner)
surface.DrawLine(x + outer, y - outer, x + inner, y - inner)
draw.SimpleText("INSTANT KILL", "TabLarge", x, y - 30, COLOR_RED, TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM)
end
return self.BaseClass.DrawHUD(self)
end
end[/QUOTE]
If I were to delete that part as you say, what will it do to my game? And will it even work?
Unless something references it somewhere else in the code, all it will do is stop the onscreen effects of the knife (whatever those are). Obviously not elegant but it should prevent people from being kicked for no reason while we wait for a better programmer than myself to notice this thread.
But a problem I noticed is this bit here
[CODE]local tr = self.Owner:GetEyeTrace(MASK_SHOT)[/CODE]
in the third line of what you posted. I have never seen that done like that before and while I assume that the person who wrote it knew what he was doing, it wouldnt hurt I guess to change it to
[CODE]local tr = self.Owner:GetEyeTrace()[/CODE]
and see what happens. If that doesn't work(it most probably will not), the best thing I can think to do is delete the entire part that you posted and wait for someone to help you. It's not great but it prevents people from being kicked for no reason.
See, it's only me though, nobody else on the server I play on has this issue.
OHHHH shit. Are you hosting it yourself? It could also be some addon you have on your computer giving you grief, I would try systematically removing addons in case its one of those.
No, it is a server hosted by a hosting company that I play on. And only I out of all people on the server, get LUA errors and get kicked when I unholster the secret knife from community bowling and community pool. The regular T knife does not do anything to me.
Bump, I would like to see if this can be fixed.
Sorry, you need to Log In to post a reply to this thread.