-
Автор темы
- #1
пофиксите луашку пж )))
ошибка:
Код:
local function VectorLerp(vecSource, vecDestination, flPercentage)
return vecSource + (vecDestination - vecSource) * flPercentage
end
local function NormalizeYaw(flYaw)
while flYaw > 180 do flYaw = flYaw - 360 end
while flYaw < -180 do flYaw = flYaw + 360 end
return flYaw
end
local refEnabled = menu.Switch('Anti Aim Improvements', 'Edge Yaw', false)
local vecTraceStart = Vector.new()
cheat.RegisterCallback('pre_prediction', function(UserCmd)
if not refEnabled:GetBool() then
return
end
local iLocalPlayerEntIndex = g_EngineClient:GetLocalPlayer()
if not iLocalPlayerEntIndex then
return
end
local pLocalPlayerEntity = g_EntityList:GetClientEntity(iLocalPlayerEntIndex)
local pLocalPlayer = pLocalPlayerEntity:GetPlayer()
local flVelocityZ = pLocalPlayer:GetProp('m_vecVelocity[2]')
local bInJump = bit.band(UserCmd.buttons, 2) == 2
if flVelocityZ ~= 0 or bInJump then
return
end
if g_ClientState.m_choked_commands == 0 then vecTraceStart = pLocalPlayer:GetEyePosition() end
local aTraceEnd = {}
local angViewAngles = g_EngineClient:GetViewAngles()
for flYaw = 18, 360, 18 do
flYaw = NormalizeYaw(flYaw)
local angEdge = QAngle.new(0, flYaw, 0)
local vecTraceEnd = vecTraceStart + cheat.AngleToForward(angEdge) * 0x60
local traceInfo = g_EngineTrace:TraceRay(vecTraceStart, vecTraceEnd, pLocalPlayerEntity, 0x200400B)
local flFraction = traceInfo.fraction
local pEntity = traceInfo.hit_entity
if pEntity and pEntity:GetClassName() == 'CWorld' and flFraction < 0.3 then
aTraceEnd[#aTraceEnd+1] = {
vecTraceEnd = traceInfo.endpos,
flYaw = flYaw
}
end
end
table.sort(aTraceEnd, function(a, b)
return a.flYaw < b.flYaw
end)
local angEdge
if #aTraceEnd >= 2 then
local vecTraceCenter = VectorLerp(aTraceEnd[1].vecTraceEnd, aTraceEnd[#aTraceEnd].vecTraceEnd, 0.5)
angEdge = cheat.VectorToAngle(vecTraceStart - vecTraceCenter)
end
if angEdge then
local flYaw = angViewAngles.yaw
local flEdgeYaw = angEdge.yaw
local flDiff = NormalizeYaw(flEdgeYaw - flYaw)
if math.abs(flDiff) < 90 then
flDiff = 0
flYaw = NormalizeYaw(flEdgeYaw + 180)
end
-- Static yaw
local flNewYaw = -flYaw
-- Apply edge yaw
flNewYaw = NormalizeYaw(flNewYaw + flEdgeYaw + 180)
flNewYaw = NormalizeYaw(flNewYaw + flDiff)
antiaim.OverrideYawOffset(flNewYaw)
end
end)
Код:
Failed to load lua Edge Yaw --ERROR--
[string "local function VectorLerp(ve..."]:11: attempt to index global 'menu' (a nil value)
stack traceback:
[string "local function VectorLerp(ve..."]:11: in main chunk--
Последнее редактирование: