English Script giving error in my bots

3 replies
Goto Page
To the start Previous 1 Next To the start
Up
Alexsandro
User
Offline Off
Hello

I have a problem to some part of my script, my bots are giving error

Quote:
LUA ERROR (ai_onspawn): attempt to call a nil value
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!


And the error is in this function:

Code:
1
2
3
4
5
6
7
8
9
10
function SetBot()
if (BotID == 0) then
parse("bot_add")
     for _,i in pairs(player(0,"table")) do
          if player(i, "exists") and player(i, "bot") then
               BotID = i
               parse("setname "..i.." "..BotName)
end;end;end;end

SetBot()



Quick help
IMG:http://img130.imageshack.us/img130/8425/2510.png
21.08.13 12:55:24 am
Up
DannY-PhantoM
User
Offline Off
eh you want for me fixing it? i can fix it now ok? but no problem!
when skullter here , his dont understand what i say
21.08.13 01:08:28 am
Up
VADemon
User
Offline Off
It's definitely the BotID variable that needs to be set first before checking it inside a onSpawn event.
From your code as it is now, I don't see any sense in using that variable; an explanation of what you want to do can be helpful.
edited 1×, last 21.08.13 03:18:03 pm
21.08.13 01:33:41 am
Up
Alexsandro
User
Offline Off
oh :0 I had forgotten this topic

well, I discovered the error, it was because I used script more intelligent bots and my server script was run faster than the bots, causing the error in the same

I would like to thank all who responded, but was already solved
IMG:http://img130.imageshack.us/img130/8425/2510.png
To the start Previous 1 Next To the start