Forum

> > CS2D > Scripts > attemp to index field '?' (a nil value)
Forums overviewCS2D overview Scripts overviewLog in to reply

English attemp to index field '?' (a nil value)

1 reply
To the start Previous 1 Next To the start

old attemp to index field '?' (a nil value)

D-D3ADxPro
User Off Offline

Quote
Using NaSH's paintball 3 script. Pressed F2 in game, and it wont open the menu. Checked console and here was the error that it displayed:

1
LUA ERROR: maps/Pb_de_dust_night:543: attempt to index field '?' (a nil value)

Here is the script with the error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
addhook("serveraction","onserveraction")
function onserveraction(id,action)
	if action == 1 then
	local captions = {}
	for i = 1,9 do
		if paintgun[i] == "" then
			captions[i] = ""
		 else
			captions[i] = paintgun[i][1].."|Ammo: "..paintgun[i][4].." / Distance: "..paintgun[i][3].." / Speed: "..paintgun[i][5].." / Weight: "..paintgun[i][6] --paintgun[i][1] --LINE 543--
		end
	end
		menu(id,pbgame_pgmenutitle.."@b,"..
		captions[1]..","..
		captions[2]..","..
		captions[3]..","..
		captions[4]..","..
		captions[5]..","..
		captions[6]..","..
		captions[7]..","..
		captions[8]..","..
		captions[9])
	elseif action == 2 then
		instructions(id)
	end
end
Line 9 is (LINE 543!)

Does anyone know how to fix this error?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview