Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
How to make Bots use buttons?
11 Antworten![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)
This is how you could make bots use buttons "intelligent":
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
Check for buttons in range if found: 	Already used by another player/bot? 	yes: 		ignore 	no: 		Check trigger chain for deadly events. (Like env_explosion near the bot) 		if safe: 			goto the button and use it. 		else 			ignore else 	Repeat this step
![](img/smiles/bigsmile.gif)
![user](img/i_friend.png)
![cs2d lua cmd](img/i_codehelp.png)
![user](img/i_friend.png)
![](img/smiles/sad.gif)
![user](img/i_friend.png)
1× editiert, zuletzt 17.12.14 15:36:18
1
2
3
4
2
3
4
local players = player(0, "table") for _,id in pairs(players) do 	if (player(id, 'bot')) then ai_use(id) end end
Not sure if it helps tho
![](img/smiles/sick.gif)
![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)