-
Автор темы
- #1
Нашёл на UC, работает великолепно в отличии от других скриптов
Код:
--[ Vertical recoil, first shot kick, firerate ]--
local weaponProps = {
M4A1 = { 1.47, 1.00, 700 },
PP19 = { 0.85, 1.00, 750 },
SCAR = { 1.60, 1.00, 500 },
M249 = { 1.10, 1.00, 700 },
MP5 = { 0.90, 1.00, 800 },
UMP = { 0.90, 1.00, 700 },
PP = { 1.20, 1.00, 900 },
AK74 = { 1.47, 1.00, 670 }
}
--[ DO NOT CHANGE ]--
local accumulatedRecoil = 0
local accumulatedSleepFraction = 0
local baseFov = 90
--[ Change these values as needed ]--
local smoothSteps = 3
local fov = 90
local function round(num)
return math.floor(num + 0.5)
end
local function normalize(num, min, max)
return (num - min) / (max - min)
end
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
if IsMouseButtonPressed(3) then
local props = weaponProps["PP"]
local recoilY = (props[1] * 19.5 * (fov / baseFov))
if smoothSteps > 1 then
recoilY = recoilY / smoothSteps
end
local fireRate = (60000 / props[3]) / smoothSteps
repeat
local totalRecoil = recoilY + accumulatedRecoil
local integerRecoil = round(totalRecoil)
accumulatedRecoil = totalRecoil - integerRecoil
accumulatedSleepFraction = accumulatedSleepFraction + (fireRate % 1)
local totalDelay = fireRate + accumulatedSleepFraction
local integerDelay = math.floor(totalDelay)
accumulatedSleepFraction = totalDelay - integerDelay
local mathballs = math.random(-2, 2)
MoveMouseRelative(mathballs, integerRecoil)
OutputLogMessage("Moving mouse by- x: " .. mathballs .. " y: " .. integerRecoil .. "\n")
if accumulatedSleepFraction >= 1 then
integerDelay = integerDelay - 1
accumulatedSleepFraction = accumulatedSleepFraction - 1
end
Sleep(integerDelay)
until not IsMouseButtonPressed(1)
end
end