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 29 10 11338 339 Next To the start

old Re: Lua Scripts/Questions/Help

spartan029
User Off Offline

Quote
Ok so i just wanna make sure...
Lua scripts are spesific to cs2d?
What does lua stand for? is it an acrenem?(for give me crapy spelling)

old Re: Lua Scripts/Questions/Help

Livia
User Off Offline

Quote
How to check, is the variable int ?

1
if (player(txt2,"health") == 0) then

If txt2 is string, it will get errored.
So it needs to check is it integer like this
1
if (checkint(txt2)) then

I need a function to check it. Please help
edited 2×, last 02.06.09 08:38:17 am

old Re: Lua Scripts/Questions/Help

Livia
User Off Offline

Quote
TheKilledDeath has written
1
tonumber(txt2)
should help.
it doesn't check if it is number, it just makes the string a number

Thanks, but it return nil..

That should work:
1
2
txt2 = tonumber(txt2)
        if (txt2==nil) then return 1; end

And thanks again, you helped me a lot.

Edit: problem again =D

1
if (player(i,"health") > 0 and player(i, "favteam")==1) then

"attempt to compare number with boolean".
So I need help with getting player team.
edited 1×, last 02.06.09 10:39:40 am

old new LUA

sacred111
User Off Offline

Quote
Hello again !
somebody can make new LUA code :
"Say:!loaded" and give all cs2d weapons and super armour
please its been very nice

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
I'm still looking for a Lua file I/O tutorial.
Google doesn't help...

EDIT:
@zqqou:

1
if (player(i,"health") > 0 and player(i, "favteam")==1) then

Maybe it throws an error because the player doesn't exists (use player(i,"exists"))

1
2
if(player(i,"exists")) then
	if (player(i,"health") > 0) and (player(i, "favteam")==1) then

Maybe that works

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
guys I need help,

I want weapon Claw as my heal teammate and kill enemy, but I have try MiroslavR script.. it's does'nt work

EDIT: NVM, I just get it
edited 1×, last 05.06.09 01:05:22 am

old Re: Lua Scripts/Questions/Help

horus
User Off Offline

Quote
lololol I just don't get LUA yet... The tutorials don't help much.

Can you guys help me with a LUA I need [want, moar like. xP] for my server? I just need to know how to make the classes script works. Like what part of the script does what, basically. Also, need help on how to make team-specific classes. [Zombies only]

EDIT: Google fails at finding tutorials to match my attention span. >.>

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
horus has written
lololol I just don't get LUA yet... The tutorials don't help much.

Can you guys help me with a LUA I need [want, moar like. xP] for my server? I just need to know how to make the classes script works. Like what part of the script does what, basically. Also, need help on how to make team-specific classes. [Zombies only]

EDIT: Google fails at finding tutorials to match my attention span. >.>


you can use Survivor/Zombie Classes script by Bertykiller here

http://unrealsoftware.de/forum_posts.php?post=120848&start=40

EDIT:

guys, I need help about buy ammo typing..
here the code

1
2
3
4
5
6
7
8
addhook("say","adm_say")
function adm_say(id, message)
	if (message ==".ammo") then
         parse("equip "..id.." 61") 
         parse("equip "..id.." 62") 
	 parse("setmoney "..id.." "..-100)
	 end
end

all I need is -100, but when I test it with 16000 money, then I type .ammo all my money go to 0 ... can someone help.. I just only want -100 not at all .. tell me if my script got wrong there
edited 1×, last 06.06.09 02:48:44 am

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
@Admirdee:

Look, here I've analyzed your code
1
2
3
4
5
6
7
8
addhook("say","adm_say")
function adm_say(id, message)
	if (message ==".ammo") then --If you say '.ammo'
		parse("equip "..id.." 61") --Gives you ammo
		parse("equip "..id.." 62") --And more ammo
		parse("setmoney "..id.." "..-100) --And sets your money to -100?!
	end
end

This is the code you should use:
1
2
3
4
5
6
7
8
9
10
addhook("say","adm_say")
function adm_say(id, message)
	if (message ==".ammo") and (player(id,"ammo">= 100) then 
		--If you have enough cash and say ''.ammo''
		parse("equip "..id.." 61") --Give ammo
		parse("equip "..id.." 62") --And ammo
		parse("setmoney "..id.." "..player(id,"ammo")-100) 
		--Substract $100 from actual cash
	end
end

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Flacko has written
@Admirdee:

Look, here I've analyzed your code
1
2
3
4
5
6
7
8
addhook("say","adm_say")
function adm_say(id, message)
	if (message ==".ammo") then --If you say '.ammo'
		parse("equip "..id.." 61") --Gives you ammo
		parse("equip "..id.." 62") --And more ammo
		parse("setmoney "..id.." "..-100) --And sets your money to -100?!
	end
end

This is the code you should use:
1
2
3
4
5
6
7
8
9
10
addhook("say","adm_say")
function adm_say(id, message)
	if (message ==".ammo") and (player(id,"ammo">= 100) then 
		--If you have enough cash and say ''.ammo''
		parse("equip "..id.." 61") --Give ammo
		parse("equip "..id.." 62") --And ammo
		parse("setmoney "..id.." "..player(id,"ammo")-100) 
		--Substract $100 from actual cash
	end
end


wth. lol. hmm I still newbie, thx for the help .

old zombie

sacred111
User Off Offline

Quote
Hello !
Can somebody LUA script !
zombie clases
its been funny
Assasin-"speedmod 15"equip 84"
warior zombie-"equip 69"equip 41"
old zombie-"equip 80" speedmod -5"
classic-"_=balanced=_
Tank- "equip 81" equip 51"equip 76"
please make this l\LUA skript its been good

old Re: Lua Scripts/Questions/Help

Silent_Control
User Off Offline

Quote
sacred111 has written
Hello !
Can somebody LUA script !
zombie clases
its been funny
Assasin-"speedmod 15"equip 84"
warior zombie-"equip 69"equip 41"
old zombie-"equip 80" speedmod -5"
classic-"_=balanced=_
Tank- "equip 81" equip 51"equip 76"
please make this l\LUA skript its been good


You mean to give the zombies in cs2d the abilities from CS 1.6?

old Request: MaxMoney

-Skull_
User Off Offline

Quote
Well guy i would like to request a lua program that can alway give you money each round, this program is just like [LaG] Clan Server one.

PM me if you done it

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("startround", "givemoney")
function givemoney(mode)
	for i = 0, 32, 1 do
		if (player(i, "exists") == true) then
			parse("setmoney "..i.." 16000")
		end
	end
end
should work for you Skull
To the start Previous 1 29 10 11338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview