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 292 93 94338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
-WiLSoN- has written
LUA ERROR: dir:19: 'do' expected near 'unlocked_classes'

line 19
1
for i,v in ipairs unlocked_classes do
wtf :S

Recopy the script from the above post and try again or just add the parenthesis that i forgot
1
for i,v in ipairs(unlocked_classes) do
I forgot it twice so you better recopy the script

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
-WiLSoN- has written
LUA ERROR: dir:47: attempt to index global 'player_deaths'(a nil value)
sorry for all this :S


isnt the same put player(v,"deaths")? (and its player_deathst no player_deaths xD)

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
-WiLSoN- has written
uhm but where's the code ??

As always, it's in my other post
I spotted some bugs and fixed them, tell me if you find more

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
yay it worked
i love u flacko *-*
but what do i need to replace to unlock the classes (on another script )
i need to add something else or just replace a name with another ?

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
-WiLSoN- has written
yay it worked
i love u flacko *-*
but what do i need to replace to unlock the classes (on another script )
i need to add something else or just replace a name with another ?


Please dont do love declarations here

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
-WiLSoN- has written
yay it worked
i love u flacko *-*
but what do i need to replace to unlock the classes (on another script )
i need to add something else or just replace a name with another ?


Ok, let's say that you have a function to let the zombies choose their class:

1
2
3
4
5
6
7
8
9
function openzmenu(id)
	local menu_buttons = "Regular Zombie" --Regular zombie unlocked by default
	if(unlocked_classes[1]==true) then --if 1st class unlocked
		menu_buttons = menu_buttons..",Fast Zombie"
		if(unlocked_classes[2]==true) then
			menu_buttons = menu_buttons..",Über Zombie"
		end
	end
end

And so on

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
ok thanks but i need this to all the T team
i mean when every T goes to spect after a minute then every zombie goes to zm again and with the new class unlocked

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
-WiLSoN- has written
ok thanks but i need this to all the T team
i mean when every T goes to spect after a minute then every zombie goes to zm again and with the new class unlocked

You mean, with the new class selected?
And they can't open a menu to change their class?

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
i mean that when every T dies,after that happens the timer begins to run until they all can respawn again
that's what i need
thanks

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
-WiLSoN- has written
i mean that when every T dies,after that happens the timer begins to run until they all can respawn again
that's what i need
thanks


Well, isn't that what I did in the big script?
When a T dies 5 times, the script switches every zombie to spectator and will change them back to T when a timer counts down (1 minute)

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
i want it to do when EVERY T dies, when there's no one else on terrorist team then the timer starts but it don't know how to "refer"(referirme) to a team that has no players :S

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
-WiLSoN- has written
i want it to do when EVERY T dies, when there's no one else on terrorist team then the timer starts but it don't know how to "refer"(referirme) to a team that has no players :S


use it to "set" how many players has a team got:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
totalt = 0
totalct = 0
totalspec = 0

	for i=1,32,1 do
		if (player(i,"exists")==true) then
			if (player(i,"team")==1) then
 totalt = totalt+1
  else
	  	if (player(i,"team")==2) then
 totalct = totalct+1
  else
	  	if (player(i,"team")==0) then
 totalspec = totalspec+1

Then, to do something when there is not any player into terrorists team:

1
2
3
if (totalt==0) then
XXXXXXXXX
end

i made this but i dont know just one thing, if "exists" value returns 0/1 or true/false, just try both "ways".
edited 1×, last 17.11.09 03:37:11 am

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Is there possible to change someone weapon damage? not all of the player, only 1.. I try search at info.txt but I can't found anything about it

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
Quote
Is there possible to change someone weapon damage? not all of the player, only 1.. I try search at info.txt but I can't found anything about it


1
2
3
4
5
6
7
8
9
addhook("hit","hitpowup")
function hitpowup(id,source,weapon,hpdmg,apdmg)
	if (id==X) then
	if (weapon==WEAPONID) then
 hpdmg = hpdmg+X  --x = you decide!
 apdmg = apdmg+X  --x = your election!
	end
	end
		end


could be?
Just try it
edited 1×, last 17.11.09 03:54:52 am
To the start Previous 1 292 93 94338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview