Forum

> > CS2D > Scripts > A nil value
Forums overviewCS2D overview Scripts overviewLog in to reply

English A nil value

11 replies
To the start Previous 1 Next To the start

old A nil value

if
User Off Offline

Quote
1
attempt to concatenate global "no_kill" <a nil value>

What has gone wrong?

The line is :
1
"No kill |("..no_kill..")"
1
2
3
4
5
6
7
8
9
addhook("startround","add_a_startround")
function add_a_startround(mode)
	for id = 1,32 do
		if player(id,"exists") then
			no_kill = 0		
		end
	end
	UpdateUserstatus()
end
,tell me what's wrong plz.

old Re: A nil value

Apache uwu
User Off Offline

Quote
Can I see the full script?

Btw, if you loop 32 times, you're just setting the same variable to 0 each time.

I recommend you use player(0,"tableliving")

old Re: A nil value

if
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
if button == 1 then
				if no_kill == 0 then
					no_kill = 1
					msg("No kill Mode enable ")	
				else
					no_kill = 0
					msg("No kill Mode disable ")	
				end
			end
1
2
3
4
5
6
addhook("hit","no_hit")
function no_hit(id,source,wpn,hpdmg)
if no_kill == 1 then
		return 1		
	end
end
edited 1×, last 25.09.11 07:25:11 pm

old Re: A nil value

if
User Off Offline

Quote
That was all the codes related to no_kill

old Re: A nil value

DC
Admin Off Offline

Quote
are you sure?
there must be no_kill in connection with .. somehwere!

(you want to add no_kill to a string with .. [=concatenate] before assigning a value to it. that's what the error message says)

old Re: A nil value

if
User Off Offline

Quote
I did a search inside the lua.Nothing else.

old Re: A nil value

DC
Admin Off Offline

Quote
then just add
1
no_skill=0
as first line to your script!

old Re: A nil value

Apache uwu
User Off Offline

Quote
Please show the entire script.

@DC lua is loose, you don't need to declare it to use it, only for tables/arrays.

old Re: A nil value

DC
Admin Off Offline

Quote
then take a look at the error message. in my eyes the problem is caused by a variable not having a value (=having a nil value)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview