1
0
mirror of https://github.com/ineedbots/iw5_bot_warfare.git synced 2025-06-28 15:11:49 +00:00

Start of the end?

This commit is contained in:
ineedbots
2021-05-07 18:47:54 -06:00
commit 8f1f131122
6 changed files with 132 additions and 0 deletions

23
scripts/test/__init__.lua Normal file
View File

@ -0,0 +1,23 @@
level:onnotify("connected", function(player)
print("Player connected: " .. player.name)
local onframe = game:oninterval(function()
if game:isalive(player) == 0 or not player:getguid():find("^bot") then
return
end
game:setdvar("bot" .. player:getentitynumber() .. "_buttons", game:randomintrange(0, 16384))
game:setdvar("bot" .. player:getentitynumber() .. "_movement", game:randomintrange(-127, 127) .. " " .. game:randomintrange(-127, 127))
game:setdvar("bot" .. player:getentitynumber() .. "_ping", game:randomintrange(0, 999))
local weapons = player:getweaponslistall()
game:setdvar("bot" .. player:getentitynumber() .. "_weapon", weapons[1 + game:randomint(weapons.getkeys():size())])
player:setplayerangles(vector:new(game:randomfloatrange(-180, 180), game:randomfloatrange(-180, 180), 0))
end, 50)
player:onnotifyonce("disconnect", function()
onframe:clear()
end)
end)