Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2269 270 271338 339 Next To the start

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
batlaizys has written
Hello could some1 tell me how to make such thing ?

If player goes to tilex :56 and tiley :56 he gets 150 health and image on him and 30 speed.

Thank you for your help (if there is any)


1
2
3
4
5
6
7
8
addhook("movetile","lol") function lol(id,x,y)
	if x==56 and y==56 then
		parse("setmaxhealth "..id.." 150")
		freeimage(id)
		image("gfx/...",1,1,id+200)
		parse("speedmod "..id.." 30")
	end
end

@Time4Parteh

1
2
3
4
5
6
add it
hudi = image("gfx/...",X,Y,1)

X and Y is the X and Y on the screen, where it should be on the screen.
remove it
freeimage(hudi)

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
batlaizys has written
@HaRe Does that picture that i type will be set off after my death ? Thanks for this script btw


Ye i think so,

@Time4parteh

theres no hook for it, you can do this to use it

1
2
3
4
5
6
7
addhook("say","lol") function lol(id,t)
	if t=="!on" then
		-- hudi = goes here
	elseif t=="!off" then
		-- freeimage goes here
	end
end

old Re: Lua Scripts/Questions/Help

Blargh
User Off Offline

Quote
What should I put in the "-- --" ?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("kill","ms_kill")
function ms_kill(id)
exp[id]=exp[id]+3
if exp[id]>= 10 then
exp[id]=0
level[id]=level[id]+1
if level[id]= 1 then
-- set a sprite on the hud --
if level[id]= 2 then
-- remove previous hud sprite --
-- set a new sprite on the hud --
msg2(id,"©000255000Level up!@C")
msg("©255075000"..player(id,"name").." reached "..level[id].." level!")
end
end

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
Blargh has written
What should I put in the "-- --" ?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("kill","ms_kill")
function ms_kill(id)
exp[id]=exp[id]+3
if exp[id]>= 10 then
exp[id]=0
level[id]=level[id]+1
if level[id]= 1 then
-- set a sprite on the hud --
if level[id]= 2 then
-- remove previous hud sprite --
-- set a new sprite on the hud --
msg2(id,"©000255000Level up!@C")
msg("©255075000"..player(id,"name").." reached "..level[id].." level!")
end
end


read this

1
2
3
4
5
6
add it
image("gfx/...",X,Y,1,id)

X and Y is the X and Y on the screen, where it should be on the screen.
remove it
freeimage(id)

old Re: Lua Scripts/Questions/Help

SkullFace
User Off Offline

Quote
BureX has written
guys i want to have 4 max players in one team . is that possible ? ( i need it for cod5 zombies )
i dont want to be a jerk but can somebody tell me this in quote ???

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
@HaRe. Is it possible to make it rechargable ? Like i go on a tile and then effect dissapears for that tile and after minute appears again...

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
batlaizys has written
@HaRe. Is it possible to make it rechargable ? Like i go on a tile and then effect dissapears for that tile and after minute appears again...


yes u can do it with

1
2
3
4
5
6
7
8
9
10
11
12
13
ischarged = 1
addhook("movetile","lol") function lol(id,x,y)
	if ischarged>=1 then
		-- Put the things here
		ischarged=0
	else
		msg2(id,"It aint charged yet, Wait 1 min")
	end
end

addhook("minute","lol2") function lol2()
	ischarged=ischarged+1
end

old Re: Lua Scripts/Questions/Help

Fehu
User Off Offline

Quote
BureX has written
BureX has written
guys i want to have 4 max players in one team . is that possible ? ( i need it for cod5 zombies )
i dont want to be a jerk but can somebody tell me this in quote ???


You mean with usgn 4 players or anyone can join?

//EDIT
BureX i dont have idea to make this ...
edited 1×, last 01.10.10 07:33:52 pm

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
batlaizys has written
@ HaRe But there is no tile stuff and i dont know how to do it...


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
ischarged = 1
addhook("movetile","lol") function lol(id,x,y)
	if x==56 and y==56 then
		if ischarged>=1 then
			parse("setmaxhealth "..id.." 150")
			freeimage(id)
			image("gfx/...",1,1,id+200)
			parse("speedmod "..id.." 30")
			ischarged=0
		else
			msg2(id,"It aint charged yet, Wait 1 min")
		end
	end
end

addhook("minute","lol2") function lol2()
	ischarged=ischarged+1
end

old Re: Lua Scripts/Questions/Help

Blocker
User Off Offline

Quote
@BureX

1
2
3
4
5
6
7
8
9
10
11
parse("mp_autoteambalance 0")
addhook("team","join_team")
function join_team(id,t)
	if t == 2 then							--if select ct team
		local tmpuser = #player(0,"team2")  --tmpuser = ct count player
		if tmpuser+1 > 4 then				--if ct mor than 4 !
			parse("maket "..id)
			return 1
		end
	end
end

work fine on dedicated!

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
BureX has written
guys i want to have 4 max players in one team . is that possible ? ( i need it for cod5 zombies )

More >

i didnt test but try it
well i didnt do my best too

old Re: Lua Scripts/Questions/Help

Fehu
User Off Offline

Quote
I have one question:

How to make image in x position and y position of player (This image cant move(Floor Image))?
To the start Previous 1 2269 270 271338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview