Inconsistancy in player:IsBot?



] lua_run_cl for k , v in ipairs(player.GetAll()) do print(v:IsBot()) end
false
false
false
] lua_run for k , v in ipairs(player.GetAll()) do print(v:IsBot()) end
> for k , v in ipairs(player.GetAll()) do print(v:IsBot()) end...
false
true
true


Easily fixed, but I was wondering if anyone else noticed this?

[editline]05:58PM[/editline]

If you’re wanting it, this is the code I’m going to use to fix this

[lua]local meta = FindMetaTable(“Player”)

function meta:IsBot()
return self:SteamID() == “BOT”
end[/lua]

Infact, it seems Garry didn’t implement player:SteamID on bots properly clientside for listen servers, which would explain this entire problem.



] lua_run_cl for k , v in ipairs(player.GetAll()) do print(v:IsBot2()) end
STEAM_0:0:10839552	false
false
NULL	false
false

And the resultant fix:

[lua]function meta:IsBot()
return self:SteamID() == “NULL” or self:SteamID() == “BOT”
end[/lua]

Has anyone contacted him about this? It’s rather annoying.