Forum




How to make Bots use buttons?
11 replies



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






edited 1×, last 17.12.14 03:36:18 pm
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




