Forum

> > CS2D > Scripts > Script giving error in my bots
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Script giving error in my bots

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Script giving error in my bots

Alexsandro
User Off Offline

Zitieren
Hello

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

Zitat
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:

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

alt Re: Script giving error in my bots

VADemon
User Off Offline

Zitieren
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.
1× editiert, zuletzt 21.08.13 15:18:03

alt Re: Script giving error in my bots

Alexsandro
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht