Forum

> > CS2D > Scripts > script doesnt work
Forums overviewCS2D overview Scripts overviewLog in to reply

English script doesnt work

5 replies
To the start Previous 1 Next To the start

old script doesnt work

deividas270
User Off Offline

Quote
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

old Re: script doesnt work

EngiN33R
Moderator Off Offline

Quote
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

old Re: script doesnt work

Apache uwu
User Off Offline

Quote
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

old Re: script doesnt work

Zurak
User Off Offline

Quote
user Apache uwu has written
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.

old Re: script doesnt work

archmage
User Off Offline

Quote
user Zurak has written
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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview