我有此代码
hook.Add( "PlayerSwitchWeapon", function( ply, oldWeapon, newWeapon )
if (tostring(newWeapon) == tostring(hololink_swep) ) then
print( "This weapon is speciall" .. newWeapon:GetClass() .. "." );
end
end );
执行时,我得到
错误,警告:lua5.3:source_file.lua:1:尝试索引a nil值(全局“挂钩”)堆栈回溯:source_file.lua:1:在主目录中 块[C]:在?