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 2142 143 144338 339 Next To the start

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
@redefinder, same mistake as Zanahoria did.
Wrong function parameters.

1
2
3
4
5
6
7
8
9
function explosion(x, y, size, damage)
	parse("explosion "..x.." "..y.." "..size.." "..damage)
end

addhook("die","explode")

function explode(v,k,w,x,y)
	explosion(x,y,300, 300)
end

old Re: Lua Scripts/Questions/Help

Zanahoria
User Off Offline

Quote
Another problem
Now only m3 works and fiveseven not
Spoiler >

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
ty

One more thing,how can I make the explosion kill only enemies(Survivors)and not kill teammates?And the zombie that explodes doesn`t get a frag for it,I need the exploding zombie to get frags with explosion and turn Survivors into zombies

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
Hi , can any one tell me the all the color numbers on script ?
Like ©000255000 .. i need only the important one (like green red BLAck yellow ....)

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
lol how the hill i gonna use paint , you mean with edit colors and take the numbers on Hue & sat ?
or i must add "000" before the number i want to edit it ?

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
memo has written
lol how the hill i gonna use paint , you mean with edit colors and take the numbers on Hue & sat ?
or i must add "000" before the number i want to edit it ?

you have all color numbers in cs2d map editor

e.g.
open gen_particles(in map editor)then select colors and you have all color numbers

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Quote
redefinder has written
ty

One more thing,how can I make the explosion kill only enemies(Survivors)and not kill teammates?And the zombie that explodes doesn`t get a frag for it,I need the exploding zombie to get frags with explosion and turn Survivors into zombies

One parameter of command explosion: Player!
This player gets a frag, and if friendlyfire is working, neither zombie, nor other zombiez will not be killed.

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
doesn`t work,I tried it,it shows error in console
1
2
3
4
5
6
7
8
9
function explosion(x, y, size, damage)
     	parse("explosion "..x.." "..y.." "..size.." "..damage.." "..sourceplayer)
end
	addhook("die","explode")
	function explode(v,k,w,x,y)
        if (sample.zombie.class[id]==6) then
     	explosion(x,y,100,100,32)
	end
end

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
You made it wrong.

That's older example with source player parameter.
1
2
3
4
5
6
7
8
9
function explosion(x, y, size, damage, [b]source[/b])
	parse("explosion "..x.." "..y.." "..size.." "..damage.." "..[b]source[/b])
end

addhook("die","explode")

function explode(v,k,w,x,y)
	explosion(x,y,300, 300, [b]v[/b])
end

old Re: Lua Scripts/Questions/Help

Zanahoria
User Off Offline

Quote
Is not working
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
laser=initArray(32)
laser01=initArray(32)

addhook("select","laserz")
function laserz(id,t,mode)
     if t == 6 then
          if (laser01[id] == 6) then
          laser01[id]=0
          freeimage(laser[id])
     else
          laser01[id]=6
          laser[id]=image("gfx/!Huevitorojo Sprites/laser.png",1,1,200+id)
          imageblend(laser[id],1)
          imagecolor(laser[id],255,0,0)
          imagealpha(laser[id],0.7)
     end
     else
-- If not selected the right weapon, Remove the laser.
laser01[id]=0
freeimage(laser[id])
     end
     if t == 10 then
          if (laser01[id] == 10) then
          laser01[id]=0
          freeimage(laser[id])
     else
          laser01[id]=10
          laser[id]=image("gfx/!Huevitorojo Sprites/laser.png",1,1,200+id)
          imageblend(laser[id],1)
          imagecolor(laser[id],255,0,0)
          imagealpha(laser[id],0.7)
     end
     else
-- If not selected the right weapon, Remove the laser.
laser01[id]=10
freeimage(laser[id])
     end
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
I think you would have to destroy them and then creating them somewhere else because the only commands for controlling dynamic objects are killobject and spawnobject

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
ok I have a couple of bugs with my script now
1
2
3
4
5
6
7
8
9
function explosion(x, y, size, damage, source)
     	parse("explosion "..x.." "..y.." "..size.." "..damage.." "..source)
end
	addhook("die","explode")
	function explode(v,k,w,x,y)
        if (sample.zombie.class[id]==6) and (player(id,"team") == 1) then 
     	explosion(x,y,100, 100, v)
	end
end
Bug#1: Sometimes the explosive zombie class doesn`t explode when killed.
Bug#2: The survivor sometimes explodes when killed.
Bug#3:Other zombie classes can explode.

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
@Redefinder: (I'm mad)
It's always the same shit here.
You guys don't even bother at looking at your own piece of code, just "let the nerds solve this shit". I wouldn't be surprised if most of you haven't read the manual.

1
2
3
4
5
6
7
8
9
10
function explosion(x, y, size, damage, source)
	parse("explosion "..x.." "..y.." "..size.." "..damage.." "..source)
end

addhook("die","explode")
function explode(v,k,w,x,y)
	if sample.zombie.class[v]==6 and player(v,"team")==1 then
	     	explosion(x,y,100, 100, v)
	end
end

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
Flacko has written
@Redefinder: (I'm mad)
It's always the same shit here.
You guys don't even bother at looking at your own piece of code, just "let the nerds solve this shit". I wouldn't be surprised if most of you haven't read the manual.

Code:
function explosion(x, y, size, damage, source)
parse("explosion "..x.." "..y.." "..size.." "..damage.." "..source)
end

addhook("die","explode")
function explode(v,k,w,x,y)
if sample.zombie.class[v]==6 and player(v,"team")==1 then
explosion(x,y,100, 100, v)
end
end


Hmm... but if i am right the thread name is Lua Scripts/Questions/Help
any way can you give me Lua manual site and tell me from where do i start .. ?

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
memo has written
Hmm... but if i am right the thread name is Lua Scripts/Questions/Help

... no comments.

Quote
any way can you give me Lua manual site and tell me from where do i start .. ?

Here
http://www.lua.org/manual/5.1/
And you should start from the begginning, because it seems like you don't understand the very basics.
To the start Previous 1 2142 143 144338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview