Forum

> > CS2D > Scripts > I can`t find error, why
Forums overviewCS2D overview Scripts overviewLog in to reply

English I can`t find error, why

3 replies
To the start Previous 1 Next To the start

old I can`t find error, why

phalenkO
User Off Offline

Quote
I created absurd a lua but it didn`t go will. Can find you error please

1
2
3
4
5
6
7
8
admin = {142925} --- 

if player(id,"usgn") == admin[id] then
if string.sub(txt, 1, 2) == "!hesoyam" then
local adam == string.sub(txt 3, 4) 
parse("sethealth ..admin.. 100")
end
end

old Re: I can`t find error, why

Cebra
User Off Offline

Quote
missing hook and function

1
local adam == string.sub(txt 3, 4)
if you want to define a var, use one equal
i think you have missed a comma between 'txt' and '3'

and maybe you should look for that:
Spoiler >


1
parse("sethealth ..admin.. 100")
this syntax isn't correct, it has to be
1
parse("sethealth "..admin.." 100")
and this won't work because there is no var admin, there is only your array

if i guess right, you want a script, which heals the admin

1
2
3
4
5
6
7
8
9
10
11
12
admin = 142925

addhook("say","_say")
function say(id,txt)
	if player(id,"usgn") == admin then
		if string.sub(txt,0,7) == "!hesoyam" then
			parse("sethealth "..id.." 100")
		end
	end
end
--untested 
--and you aren't able to use more than one admin
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview