Forum

> > CS2D > Scripts > [Lua Problem] An error I refuse to understand
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch [Lua Problem] An error I refuse to understand

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt [Lua Problem] An error I refuse to understand

EngiN33R
Moderator Off Offline

Zitieren
The code: http://pastebin.com/PjyD373S

Apparently an error appears on the line 50, 'attempt to concatenate a nil value'. I refuse to understand it because the debug messages that show the functions' return values show them okay and nothing else can theoretically be nil. I tried restarting the game (CS2D can sometimes glitch up a bit) - no effect. Please help if you can. I'll provide all the necessary extra info.

alt Re: [Lua Problem] An error I refuse to understand

Lee
Moderator Off Offline

Zitieren
Doesn't seem like you've tested getweapon with n+(8*(p-1)) for n>1.

Since getweapon is
1
2
3
4
5
function getweapon(b,n)
	if (basedata[b].hardware[n]~=nil) then
		return equipment[basedata[b].hardware[n].type].name.."|"..equipment[basedata[b].hardware[n].type].price
	end
end

this returns nil if basedata[b].hardware[n] is nil.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht