Forum

> > CS2D > Scripts > Bot aim
Forums overviewCS2D overview Scripts overviewLog in to reply

English Bot aim

No replies
To the start Previous 1 Next To the start

old Bot aim

DetectiveConan
User Off Offline

Quote
Hi,guys
My Script has a bug,It's If I'm a Counter Terrorist,My Friend Bot will aim me,enemy is aim me,too.So,The bug just is My Friend Bot will aim me.
This is code↓
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
tarx={}
tary={}
allx={}
ally={}
somex={}
somey={}

function aim4()
    for key, value in pairs(player(0,"table")) do
        if player(value,"bot") then
          for gg, var in pairs(player(0,"table")) do
            if player(value,"team")~=player(var,"team") and player(var,"health")>0 and player(var,"exists") and player(value,"exists") and player(value,"tilex")>0 and player(value,"tiley")>0 and player(var,"tilex")>0 and player(var,"tiley")>0 then
 if unpack(tarx)==nil and unpack(tary)==nil then
        table.insert(tarx,gg,player(var,"x"))
        table.insert(tary,gg,player(var,"y"))
 elseif unpack(tarx)~=nil and unpack(tary)~=nil then
  table.remove(tarx,gg)
  table.remove(tary,gg)
  table.insert(tarx,gg,player(var,"x"))
  table.insert(tary,gg,player(var,"y"))
 end
                for _number,id in pairs(tarx) do
                  if unpack(allx)==nil then
         table.insert(allx,_number,id-player(value,"x"))
                  else
                    table.remove(allx,_number)
                    table.insert(allx,_number,id-player(value,"x"))
                  end
                  for _nb, xxx in pairs(allx) do
                    if unpack(somex)==nil then
                      table.insert(somex,_nb,xxx)
                               else
                                 table.remove(somex,_nb)
                                 table.insert(somex,_nb,xxx)
                               end
                  end
        if math.min(math.abs(unpack(somex))) and player(var,"team")~=player(value,"team") then
                  targetx=math.min((unpack(somex))+player(value,"x"))
				end
              end
                for _number,id in pairs(tary) do
                  if unpack(ally)==nil then
                    table.insert(ally,_number,id-player(value,"y"))
                             else
                               table.remove(ally,_number)
                               table.insert(ally,_number,id-player(value,"y"))
                             end
                             for _nb, xxx in pairs(ally) do
                              if unpack(somey)==nil then
                                table.insert(somey,_nb,xxx)
                                         else
                                           table.remove(somey,_nb)
                                           table.insert(somey,_nb,xxx)
                                         end
                            end
          if math.min(math.abs(unpack(somey))) and player(var,"team")~=player(value,"team") then
                  targety=math.min((unpack(somey))+player(value,"y"))
						end
            end
              ai_aim(value,targetx,targety)
              for _,idd in pairs(playerweapons(value)) do
                if idd~=55 and idd~=56 then
                  parse("equip "..value.." "..idd)
                  ai_attack(value)
                end
              end
            end
        end
    end
end
end
sorry,my english is bad.
Thank you for helping.
edited 4×, last 20.08.20 07:19:51 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview