Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MB.AddHook("CreateMove",function(cmd) --Thanks Tyler Wearing!
- local lp = MB.lp()
- if not MB.shooteveryone then
- local trace = util.GetPlayerTrace(lp)
- local traceRes = util.TraceLine(trace)
- if traceRes.HitNonWorld then
- local target = traceRes.Entity
- if target:Health() > 0 and IsValid(target) and v ~= lp then
- MB.temptarg = target
- end
- end
- if MB.aim and IsValid(MB.targ) and MB.targ:Health() > 0 and table.HasValue(player.GetAll(), MB.targ) then
- local absVel = MB.targ:GetAbsVelocity() * 0.012
- local targpos = MB.targ:EyePos() - absVel + absVel
- local angle = Angle(0,0,0)
- if MB.TTT and IsValid(lp:GetActiveWeapon()) and lp:GetActiveWeapon().Primary then
- local Cone = MB.lp():GetActiveWeapon().Primary.Cone
- local vecCone = Vector(-1 * Cone, -1 * Cone, 0)
- angle = DS_manipulateShot(DS_md5PseudoRandom(DS_getUCMDCommandNumber(cmd)), targpos - lp:EyePos(), vecCone):Angle()
- else
- angle = (targpos - lp:EyePos()):Angle()
- end
- cmd:SetViewAngles(angle) --Thanks Tyler Wearing!
- local tracedata = {}
- tracedata.start = lp:EyePos()
- tracedata.endpos = MB.targ:EyePos()
- tracedata.filter = lp
- local traceRes = util.TraceLine(tracedata)
- if traceRes.HitNonWorld and traceRes.Entity and IsValid(traceRes.Entity) and MB.shootwhileaim then
- cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_ATTACK)) --Thanks Tyler Wearing!
- end
- else
- MB.aim = false
- MB.targ = MB.temptarg
- end
- elseif MB.aim then
- for k, v in pairs(player.GetAll()) do
- if MB.MESPCheck(v) then
- local tracedata = {}
- tracedata.start = lp:EyePos()
- tracedata.endpos = v:EyePos()
- tracedata.filter = lp
- local trace = util.TraceLine(tracedata)
- if trace.HitNonWorld and trace.Entity == v then
- local absVel = v:GetAbsVelocity() * 0.012
- local angle = Angle(0,0,0)
- if MB.TTT and IsValid(lp:GetActiveWeapon()) and lp:GetActiveWeapon().Primary then
- local Cone = MB.lp():GetActiveWeapon().Primary.Cone
- local vecCone = Vector(-1 * Cone, -1 * Cone, 0)
- angle = DS_manipulateShot(DS_md5PseudoRandom(DS_getUCMDCommandNumber(cmd)), (v:EyePos() - absVel + absVel) - lp:EyePos(), vecCone):Angle()
- else
- angle = ((v:EyePos() - absVel + absVel) - lp:EyePos()):Angle()
- end
- cmd:SetViewAngles(angle)
- if trace.HitNonWorld and trace.Entity and IsValid(trace.Entity) and MB.shootwhileaim then
- cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_ATTACK)) --Thanks Tyler Wearing!
- end
- return
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment