Forum

> > CS2D > Scripts > I can`t find error, why
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch I can`t find error, why

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt I can`t find error, why

phalenkO
User Off Offline

Zitieren
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

alt Re: I can`t find error, why

Cebra
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht