Forum

> > CS2D > Scripts > attempt to compare number with nil
Forums overviewCS2D overview Scripts overviewLog in to reply

English attempt to compare number with nil

2 replies
To the start Previous 1 Next To the start

old attempt to compare number with nil

MikuAuahDark
User Off Offline

Quote
ugh, point system 0.4 was ready to released. but there is a error with the a new featurre, change say system with say system(say: !say 1 1 = !say <saysystem id> <color id> = !say "Time say system" "Red") so what's wrong in here?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--[[-- Removed --]]--
addhook("say","point_say")
function point_say(id,txt)
	if txt:sub(1,4)=="!say" then
		success = {}
		color = tonumber(txt:sub(6,7))
		saysys = tonumber(txt:sub(9,10))
		if color>=0 and color<=3 then
			say_color[id]=color
			success[1]=true
		end
		if saysys>=0 and saysys<=4 then
			say_system[id]=saysys
			success[2]=true
		end
		if success[1]~=nil and success[2]~=nil then
			msg2(id,string.char(169).."255255255"..language[lang[id]][40])
		end
		return 1
	end
--[[-- Removed --]]--
Error:
1
LUA ERROR: sys/lua/pointscript.lua:430: attempt to compare number with nil
Line 430:
1
if saysys>=0 and saysys<=4 then
i was checking everything. can someone give me a solution?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview