Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ubot.aimbot.PredictSpread = function(ang)
- local wep = ubot.lp:GetActiveWeapon()
- if (wep.Base ~= "weapon_cs_base") then return ang end
- local seed = forceofnature.randseedget()
- local vecSpread = ubot.num2vec(ubot.aimbot.GetCone(wep) * -1)
- local vecRight = Vector(0,-1,0)
- local vecUp = Vector(-(ang:Forward()), 0, 0)
- local x, y, z = 0, 0, 0
- local bias = forceofnature.cvarget("ai_shot_bias", CVAR_FLOAT)
- local biasMin = forceofnature.cvarget("ai_shot_bias_min", CVAR_FLOAT)
- local biasMax = forceofnature.cvarget("ai_shot_bias_max", CVAR_FLOAT)
- local shotbias = ((biasMax - biasMin) * bias) + biasMin
- local flatness = (math.abs(shotbias) * 0.5)
- while (z > 1) do
- x = (forceofnature.randfloat(-1,1) * flatness) + (forceofnature.randfloat(-1,1) * (1 - flatness))
- y = (forceofnature.randfloat(-1,1) * flatness) + (forceofnature.randfloat(-1,1) * (1 - flatness))
- if (shotbias < 0) then
- x = (x >= 0) and (1.0 - x) or (-1.0 - x)
- y = (y >= 0) and (1.0 - y) or (-1.0 - y)
- end
- z = (x*x)+(y*y)
- end
- local spread = ang:Forward() + (x * vecSpread.x * vecRight) + (y * vecSpread.y * vecUp)
- return spread
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement