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 2233 234 235338 339 Next To the start

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
@Msek

1
2
3
4
5
6
addhook("attack","ms_turret")
function ms_turret(id,tilex,tiley)
sx=player(id,"tilex")
sy=player(id,"tiley")
     parse('spawnobject 8 '..(sx+1)..' '..(sy+1)..' 0 0 '..player(id,"team")..' '..id)
end

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
@Terminator Your request would be difficult as there is no set ammo function, so then, even if the person does not have the required amo for the required gun, yet still has game bullets, he could still shoot them, creating issues

old Re: Lua Scripts/Questions/Help

head600
BANNED Off Offline

Quote
hi all

i need posion weapon

random 1-10

weapon = mac 10

if random = 1

- 10 hp

and msg you posioned by xxxxx


and

i need print screen on one picture(one gfx)

how to make this!?
edited 1×, last 17.08.10 01:54:14 am

old Re: Lua Scripts/Questions/Help

lordcrap
COMMUNITY BANNED Off Offline

Quote
I think you have too few ends. )
Try this:

1
2
3
4
5
6
7
8
9
10
addhook("say","player_say")end
function player_say(id,txt)end
	if(txt=="!usp") then end
		parse("equip "..id.." 1")end
	if(txt=="!glock") then end
		parse("equip "..id.." 2")end
	if(txt=="!deagle") then end
		parse("equip "..id.." 3")end
	end
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
OMG, dude, those are just too many ends
1
2
3
4
5
6
7
8
9
10
addhook("say","player_say")end
function player_say(id,txt)end
	if(txt=="!usp") then
		parse("equip "..id.." 1")
	elseif(txt=="!glock") then
		parse("equip "..id.." 2")
	elseif(txt=="!deagle") then
		parse("equip "..id.." 3")
	end
end

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
try this:
1
2
3
4
5
6
7
8
addhook("say","hi_say")
function hi_say(id,tilex,tiley,txt)
	if txt == "hi" then
		if player(id,"tilex") == 50 and player(id,"tiley") == 47 then
			menu(id,"Menu,1,2,3,4,5,6,7,8,9")
		end
	end
end

P.S: You want edit cs2d tibia? if "yes" change it in npc.lua file.

old Re: Lua Scripts/Questions/Help

Wolf97
User Off Offline

Quote
example i need a title (world of warcraft)
have 1 min lvl/25 max lvl
classes
warrior- 125 hp super armor +++ damage
paladin- 125 hp super armor ++ damage 10 hp recover per sec
hunter- 100 hp heavy armor ++ damage
shaman- 100 hp heavy armor ++ damage 10 hp recover per sec
rogue- 100 hp chose of armor or stealth suit ++++ damage
priest- 90 hp light armor +++ damage 20 hp recover per sec
mage- 95 hp light armor +++++ damage

old Re: Lua Scripts/Questions/Help

head600
BANNED Off Offline

Quote
MSek has written
try this:
1
2
3
4
5
6
7
8
addhook("say","hi_say")
function hi_say(id,tilex,tiley,txt)
	if txt == "hi" then
		if player(id,"tilex") == 50 and player(id,"tiley") == 47 then
			menu(id,"Menu,1,2,3,4,5,6,7,8,9")
		end
	end
end

P.S: You want edit cs2d tibia? if "yes" change it in npc.lua file.



this is dont work!!!

old Re: Lua Scripts/Questions/Help

beckerchen
User Off Offline

Quote
You forgot the () after the "if"

1
2
3
4
5
6
7
8
addhook("say","hi_say")
function hi_say(id,tilex,tiley,txt)
	if (txt == "hi") then
		if (player(id,"tilex") == 50 and player(id,"tiley") == 47) then
			menu(id,"Menu,1,2,3,4,5,6,7,8,9")
		end
	end
end

old Re: Lua Scripts/Questions/Help

head600
BANNED Off Offline

Quote
beckerchen has written
You forgot the () after the "if"

1
2
3
4
5
6
7
8
addhook("say","hi_say")
function hi_say(id,tilex,tiley,txt)
	if (txt == "hi") then
		if (player(id,"tilex") == 50 and player(id,"tiley") == 47) then
			menu(id,"Menu,1,2,3,4,5,6,7,8,9")
		end
	end
end



DONT WORK

old Re: Lua Scripts/Questions/Help

beckerchen
User Off Offline

Quote
head600 has written
beckerchen has written
You forgot the () after the "if"

1
2
3
4
5
6
7
8
addhook("say","hi_say")
function hi_say(id,tilex,tiley,txt)
	if (txt == "hi") then
		if (player(id,"tilex") == 50 and player(id,"tiley") == 47) then
			menu(id,"Menu,1,2,3,4,5,6,7,8,9")
		end
	end
end



DONT WORK


ahh I see the problem

1
2
3
4
5
6
7
8
9
10
11
12
addhook("say","hi_say")
function hi_say(id,txt)
	if(txt=="hi") then
		if (player(id,"tilex")==50 and player(id,"tiley")==47)then
			hi_menu(id)
		end
	end
end

function hi_menu(id)
	menu(id,"Menu,1,2,3,4,5,6,7,8,9")
end

that must work

Quote
hi all

i need posion weapon

random 1-10

weapon = mac 10

if random = 1

- 10 hp

and msg you posioned by xxxxx


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

random_poison=initArray(32)

addhook("hit","poison_hit")
function posison_hit(id,source,weapon,hpdmg,apdmg)
	if(weapon==23)then
		if(random_poison[id]>=0 and random_poison[id]<10) then
			random_poison[id]=random_poison[id]+1
		if(random_poison[id]==1) then
			msg2(id,"you got poisoned by "..(player(source,"name")).."!")
			parse("sethealth "..(player(id,"health")-10))
		if(random_poison[id]==10) then
			random_poison[id]=1
		end
	end
end

You said you want to have that every 10th hit is poisoned and the victim got 10hp damage?

Or do you want that the victim gots 10hp damage every 10seconds?     

The script I wrote would make that every 10th hit is poisoned and the victim got 10hp damage when he is hit by a poisoned bullet
               



Sry for my terrible English
edited 2×, last 17.08.10 08:32:23 pm

old Re: Lua Scripts/Questions/Help

head600
BANNED Off Offline

Quote
i want this but i cant make ( whats wrong?)

parse("setarmor "..id.." 200")

parse("shake "..id.." 200")
edited 1×, last 18.08.10 12:46:05 am

old Re: Lua Scripts/Questions/Help

beckerchen
User Off Offline

Quote
Quote
if you shot with mac10 %10 luck for poison if you get poisoned you lose 5 hp every sec and poison 5sceond


I don't test it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end

random_poison=initArray(32)
poison_timer=initArray(32)

addhook("ms100","random_poisoning")
function random_poisoning()
	if(random_poison[id]>=0 and random_poison[id]<10) then
		random_poison[id]=random_poison[id]+1
	end
	if(random_poison[id]==10) then
		random_poison[id]=0
	end
end

addhook("spawn","poison_off")
function poison_off(id)
	poison_timer[id]=0
end

addhook("hit","poison_hit")
function posison_hit(id,source,weapon,hpdmg,apdmg)
     if(weapon==23)then
          if(random_poison[id]==1) then
               msg2(id,"you got poisoned by "..(player(source,"name")).."!")
               poison_timer[id]=1
          end
     end
end

addhook("second","poisoned_timer")
function poisoned_timer()
	for i=1,32,1 do
	if (poison_timer[id]>0) then
		poison_timer[id]=poison_timer[id]+1
		parse("sethealth "..i.." "..(player(i,"health")-5))
	end
	if (poison_timer[id]==6) then
		poison_timer[id]=0
	end
end

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
I need it to my script:
text of the high level (like leader in gun-game).
If i join i have level: -4 lvl's of leader.
If anybody get 20 level is message: msg("©000255000"..player(id,"name").." Has win the game!") and round restart.

•Levels + exp future
Spoiler >

Thanks in advance!
P.S: Sorry for my bad english
To the start Previous 1 2233 234 235338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview