Forum

> > CS2D > Scripts > script doesnt work
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch script doesnt work

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt script doesnt work

deividas270
User Off Offline

Zitieren
I was trying to make script that would give me 250 hp when i spawn, but the problem is that it doesnt work.
Could someone tell me how to fix this?
1
2
3
4
5
6
addhook("spawn","spawn")
function spawn(id)
if(player(id,"usgn")==22269) then
parse("setmaxhealth "..id.."250")
end
end

alt Re: script doesnt work

EngiN33R
Moderator Off Offline

Zitieren
1
2
3
4
5
6
addhook("spawn","spawn")
function spawn(id)
if(player(id,"usgn")==22269) then
parse("setmaxhealth "..id.." 250") -- You just forgot a space before 250 to separate it from the player ID
end
end

alt Re: script doesnt work

Apache uwu
User Off Offline

Zitieren
You could enable the wrapper to avoid these problems.

1
2
3
4
5
6
7
8
9
dofile("sys/lua/wrapper.lua")

addhook("spawn","spawn")

function spawn(id)
	if player(id,"usgn")==22269 then
		setmaxhealth(id,250)
	end
end

alt Re: script doesnt work

Zurak
User Off Offline

Zitieren
user Apache uwu hat geschrieben
You could enable the wrapper to avoid these problems.

1
2
3
4
5
6
7
8
9
dofile("sys/lua/wrapper.lua")

addhook("spawn","spawn")

function spawn(id)
	if player(id,"usgn")==22269 then
		setmaxhealth(id,250)
	end
end

i have noticed that the wrapper doesn't seem to work in a lot of situations for me. idk if im doing something wrong, but i put the wrapper dofile in the server.lua file.

alt Re: script doesnt work

archmage
User Off Offline

Zitieren
user Zurak hat geschrieben
i have noticed that the wrapper doesn't seem to work in a lot of situations for me. idk if im doing something wrong, but i put the wrapper dofile in the server.lua file.

Be sure it is the first thing you dofile.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht