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 2145 146 147338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Zeik
User Off Offline

Quote
ah, thanks.

but, when it kills the survivors, they don't change team

× CustomKill
× Hit

>Now i'm trying with hit again...

1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
	if player(id,weapon)==86 then
    	hpdmg = 200
	return 0
	end
end
×Doesn't work, i don't know what's the problem :S
edited 5×, last 24.01.10 05:37:57 am

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
RiT has written
ah, thanks.

but, when it kills the survivors, they don't change team

×CustomKill
×Hit

>Now i'm trying with hit again...

1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
     if player(id,weapon)==86 then
     hpdmg = 200
     return 0
     end
end

×Doesn't work, i don't know what's the problem :S

I don`t know if this works but try it.
1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
     if player(id,weapon)==86 then
     parse ("maket "..victim)
     return 0
     end
end
There is also a mush easier way to kill survivors with only 1hit with gutbomb.You can set gutbomb weapon damage to 100000.
1
parse ("mp_wpndmg \"Gut Bomb\" 100000")

old Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Quote
redefinder has written
RiT has written
ah, thanks.

but, when it kills the survivors, they don't change team

×CustomKill
×Hit

>Now i'm trying with hit again...

1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
     if player(id,weapon)==86 then
     hpdmg = 200
     return 0
     end
end




×Doesn't work, i don't know what's the problem :S

I don`t know if this works but try it.
1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
     if player(id,weapon)==86 then
     parse ("maket "..victim)
     return 0
     end
end
There is also a mush easier way to kill survivors with only 1hit with gutbomb.You can set gutbomb weapon damage to 100000.
1
parse ("mp_wpndmg \"Gut Bomb\" 100000")


omg why you do all that , just make the Gutbomb dmg high , when any zombie hit a survivor the survivor will die and be a zombie

old Re: Lua Scripts/Questions/Help

StirlizZ-Fapicon
Super User Off Offline

Quote
addhook("say","spawn11")
function spawn11(id,txt)
     if(txt=="!mflare") then
freeimage(id)
id1=image("gfx/flare2.bmp",0,0,200)
imagescale(id1,1,1)
imageblend(id1,1)
imagealpha(id1,0.7)
if (player(id,"team") == 2) then
imagecolor(id1,255,255,255)

elseif (player(id,"team") == 1) then
imagecolor(id1,255,255,255)
end
     end
end




When i say !mflare script must draw flare at my position. But he follow me. Smbdy can fix it?

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Just change image mode perimeter...

Quote
                    Mode 0 for floor image, mode 1 for top image and
                    mode 2 for HUD image.
                    Mode 101-132: draw under this player
                    Mode 201-232: draw over this player

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
Question,
for i, v in ipairs(table) do isn't working right, I'm trying to loop through values in a table, yet it's only reading the first value.
Can somone show me an example, cause, I can't get it from the manuel.

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Probably because you are using ipairs instead of pairs.

Both of those functions have differences.

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Quote
Fapicon has written
that's right:
Id1=image(gfx/flare2.bmp,0,0,2)

HUD is thing that shows your money, health, e.t.c.
But If you want to make just flare, that is not following player, and is on ground, you must:
1
id1=image("gfx/flare2.bmp",player(id,"x"),player(id,"y"),0)
And if you want to make it as light, try imageblend(id1,1)

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
Thanks blazzing, i'll try that, What does ipairs do then? Iterate thruogh the table reading the first value?
Nope, Still didn't work, Can you show me how?
is it like this?
t = {1,2,3}
function Magical(txt)
for i, Magic in pairs(t) do
if Magic == txt then
BLA BLA BLA..
Is this how it is supposed to look?
Cause I printed the value for something like this, and it printed only my usgn, not the other one.

old ----------------->

BrunoRZ
User Off Offline

Quote
addhook("hit","laser")
function laser(id,source,w,hpdmg,apdmg)
     if (w == 45) then
     parse ("sethealth "..id.." "..player(id,"health") + 20)
     return 1
     end
end
> What's the problem whit this lua script?

IT IS NOT WORKING !

old Re: Lua Scripts/Questions/Help

YellowBanana
BANNED Off Offline

Quote
1
2
3
4
5
6
7
addhook("hit","laser")
function laser(id,source,w,hpdmg,apdmg)
     if (w == 45) then
     parse ("sethealth "..id.." "..(player(id,"health") + 20))
     return 1
     end
end

fixed some parentheses and it worked fine with me.

old Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Quote
ALright, I give up with this script, It's doing soemthing really weird, when I join the team t it gives me my usgn twice, and when I join ct it gives me mine and the other one, Heres the script.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ADMIN={}
ADMIN.SuperAdmins={1,2}--Just for example
addhook("team","Team")
function Team(p,team)
for i, y in ipairs(ADMIN.SuperAdmins) do
print(""..y.."")
if team == 1 then
print(""..y.."")
if player(p,"usgn") == y then--
	return 0
	else
	return 1
end
end
end
end
Alright, If I join t, or if team is equal to one it gives me two Usgn that are the same, though if I join ct, I get mine and another's, I don't really get why it's doing this, So could someone help me with this? I just want to know why it gives me different values based on that.
Previous arangments for ADMIN={} were already made and that works, it's just not working HERE
To the start Previous 1 2145 146 147338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview