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 2183 184 185338 339 Next To the start

old Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Quote
Actually, return 1 to abort the collection.
1
2
3
4
5
6
7
-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","walkover")
function walkover(id,iid,type)
     return 1
end

old REPAIR PLZ

Soja1997
User Off Offline

Quote
1
2
3
4
5
addhook("say","tekst")
function tekst(id,txt) 
	if (txt=="!papieros") or (txt=="!cigarette") then
     parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y")))
end

Who can Repair and make
1
parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y")))
every six seconds

2.
who can make if i hit player he have flash id 100

3.
who can make if i say !drunk shake ID 3000
edited 5×, last 04.04.10 02:05:28 pm

old Re: Lua Scripts/Questions/Help

Fasttt
User Off Offline

Quote
I want bots can not damage human, but bots can damage bots.

1
2
3
4
5
6
7
8
addhook('hit','bot_hit')
function bot_hit(killer,victim)
	if player(killer,'bot') == true then --if IS bot
		if player(victim,'bot') == false then  --if NOT bot
			return 1
		end
	end
end

it does not works!
I replaced "true" and "false" and received right script (!!!):

1
2
3
4
5
6
7
function bot_hit(killer,victim)
	if player(killer,'bot') == false then -- if NOT bot
		if player(victim,'bot') == true then -- if IS bot
			return 1
		end
	end
end
surprisingly, isn't it?

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
Soja1997 has written
1
2
3
4
5
addhook("say","tekst")
function tekst(id,txt) 
	if (txt=="!papieros") or (txt=="!cigarette") then
     parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y")))
end

Who can Repair and make
1
parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y")))
every six seconds

2.
who can make if i hit player he have flash id 100

3.
who can make if i say !drunk shake ID 3000


Spoiler >
edited 2×, last 04.04.10 10:41:24 pm

old Buy Menu

Soja1997
User Off Offline

Quote
Somebody can make the Buy Menut for me because alone I am not able
Medikit|500$
Bandage|100$
Vodka|100$          parse("shake "..id.." 20000")     
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$
edited 2×, last 05.04.10 10:52:32 am

old Re: Lua Scripts/Questions/Help

GreenDevil
User Off Offline

Quote
Hi all, i tryied to do when i reload i getting a portal gun (for fun)
It doesn't work why? please help
1
2
3
4
5
6
addhook("reload","player")
function player(id,mode)
	if (player(id,"reload") == 1) then
		parse('equip "..id.." 88')
end
end

old Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Quote
@oleg58300
The hit hook's parameters are as follows:
hit(id,source,weapon,hpdmg,apdmg)
Yours is the other way round, so the killer is actually the victim and vice versa.

old Buy Menu

Soja1997
User Off Offline

Quote
Somebody can make the Buy Menut for me because alone I am not able
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Editorman has written
Hi all, i tryied to do when i reload i getting a portal gun (for fun)
It doesn't work why? please help
1
2
3
4
5
6
addhook("reload","player")
function player(id,mode)
	if (player(id,"reload") == 1) then
		parse('equip "..id.." 88')
end
end


Maybe something like this?

1
2
3
4
5
6
addhook("reload","player")
function player(id,mode)
	if mode == 1 then
		parse('equip "..id.." 88')
end
end

old Buy Menu

Soja1997
User Off Offline

Quote
Somebody can make the Buy Menut for me because alone I am not able
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Editorman has written
Edit:

Doesn't work i dont getting the portal gun


LOL.

you can get like this

1
2
3
4
5
6
addhook("reload","player")
function player(id,mode)
	if (mode == 1 or mode == 2) then
		parse("equip "..id.." 88")
	end
end

or

1
2
3
4
addhook("reload","player")
function player(id,mode)
	parse("equip "..id.." 88")
end

but you need to shot then reload, you can't by pressing R without any reload on weapon.

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
Somebody can make the Buy Menut for me because alone I am not able
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$

HEEELP MEE!

old Re: Lua Scripts/Questions/Help

YellowBanana
BANNED Off Offline

Quote
Soja1997 has written
Somebody can make the Buy Menut for me because alone I am not able
Medikit|500$
Bandage|100$
Vodka|100$ parse("shake "..id.." 20000")
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$

HEEELP MEE!



Here you go

Spoiler >


And this one is even easier to edit:

Spoiler >


use f2 to open the buymenu.
edited 2×, last 05.04.10 12:12:25 pm

old Re: Lua Scripts/Questions/Help

DRoNe
User Off Offline

Quote
How i make something like a rank if player1 has more kills like player2 and that player1 will be added to message ...

i was trying to make it but in vain

old Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Quote
pls explain better.
do you mean when for example:
player 1 kills player 2 -->
player 1 has more kills than player 2 -->
player 1 gets a message?

1
2
3
4
5
6
addhook ("kill","killen")
function killen(id,oper)
if(player(id,"score")>player(opfer,"score")) then
msg2 (id,"your kills are higher than you enemys one");
end
end

old Re: Lua Scripts/Questions/Help

Patasuss
User Off Offline

Quote
Hi,
My script failes to change the imagealpha:
1
2
3
4
5
bgid=image("gfx/pgfx/whitepix.bmp",0,1,1)
imagepos(bgid,0,0,0)
imagescale(bgid,map("xsize")*32,map("ysize")*32)
imageblend(bgid,1)
imagealpha(bgid,0.5)
Could someone help me?
BTW: This script draws an image over the hole map, and whitepix.bmp is a 1x1 px image
To the start Previous 1 2183 184 185338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview