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 2189 190 191338 339 Next To the start

old Re: Lua Scripts/Questions/Help

SkullFace
User Off Offline

Quote
Guys what is wrong here :

addhook("spawn",ghostmode")
function ghostmode(id)
if player(id,"team")== 1 then
parse("setmaxhealth "..id.." 200")
parse("speedmod "..id.." 10")
parse("equip "..id.." 84")
parse("mp_wpndmg claw 100")
elseif player(id,"team")== 2 then
parse("equip "..id.." 87")
parse("mp_wpndmg awp 100")
parse("mp_wpndmg_z1 awp 150")
parse("mp_wpndmg_z2 awp 200")
parse("mp_wpndmg "/Laser Mine/" 0")
     end
end
end

and how do i do for "use button" to make with lua script?

PLS HELP ME IM NOOB AT THIS
edited 1×, last 15.04.10 10:06:20 pm

old Re: Lua Scripts/Questions/Help

Saibot
User Off Offline

Quote
I hope it works. :p

Spoiler >



old Re: Lua Scripts/Questions/Help

Sleepin
User Off Offline

Quote
There is info in the lua folder(info.txt).

For use hook it should look something like this:

addhook("use","random")
function random(id,event,data,x,y)
if event ==      3 then
msg("Someone is defusing")
end
end
edited 2×, last 16.04.10 01:44:50 am

old Re: Lua Scripts/Questions/Help

Skullz
User Off Offline

Quote
hey i wanna know how to make scripts like starting from the 0, i've asked this before and people send me links that require i bit of knowledge on lua scripts, wich i don't got. like, i don't know absolutely nothing. and ALL my friends script then i wanna join them. i don't know nothing of lua scripts but i wanna start. please help me. i would thank you A LOT.

old Re: Lua Scripts/Questions/Help

YellowBanana
BANNED Off Offline

Quote
I'm not gonna script it for you,
but ill tell you what to do in general.

First you have to make a table of booleans, if a person is poisoned or not.

1
2
so something like, players = initArray(32,false);
			hasKnife = initArray(32,false);

then use an attack hook, and if a player has a poisonous knife, the other player gets poisoned,

1
2
3
4
5
function attack(player,victim)
if( player.hasKnife()) then
	players[victim] = true
end
end

then add a ms100 hook, and go through the list of players to check which one is poisoned, and substract an amount of health if he is poisoned.

You could also add a cool green poison effect to the person who got poisoned.

To get a poisonous knife, u have to use some kind of menu script, but just search for them.
It involves addhook menu and serveraction.
That's about it.. now have fun scripting it.

old Can I do that?

SDKey
User Off Offline

Quote
Hello,
I have some questions:

> 1. Can I change quantity of ammo in weapon?
> 2. Can I define, the player is dead or not?
> 3. Can I remove the indicator of health?
> 4. Can I change % in (armor, heavy armor, Medic armor)?
> 5. Can I give to player second "primary" weapon with it's real quantity ammo or without ammo?

Thanks. Sorry for bad english.

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
1-No, you can't really do that, but you can achieve sth similar in other (ugly) ways.
2-parse("killplayer"..insert_id_here)
3-No
4-Not sure what you mean
5-Only with full ammo.

old Re: Lua Scripts/Questions/Help

SDKey
User Off Offline

Quote
>1. Can I change quantity of ammo in weapon?
     What ugly ways? I like ugly ways.
>4. Can I change % in (armor -50%, heavy armor - 75%, Medic armor - 10hp)?




edited 3×, last 16.04.10 09:24:04 pm

old Re: Lua Scripts/Questions/Help

Sleepin
User Off Offline

Quote
So is this right?

More >

old Re: Lua Scripts/Questions/Help

Cure Pikachu
User Off Offline

Quote
Most of them are OK I guess, but something's wrong. (Click on More)

More >

More >

More >

More >

More >

More >

P.S. I am not an expert in LUA...
edited 7×, last 17.04.10 09:31:25 am

old Re: Lua Scripts/Questions/Help

Cure Pikachu
User Off Offline

Quote
banana200000 has written
But when I press serveraction 1 it simply shows a error on the console,how do you fix it?

Read the last post. I forgot there's an error there.

old Re: Lua Scripts/Questions/Help

Cure Pikachu
User Off Offline

Quote
banana200000 has written
And for some reason it shows error:attempt to globel players.How do you fix?

...and it doesnt work

See if this full script helps
More >
To the start Previous 1 2189 190 191338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview