Forum

> > CS2D > Scripts > Some trouble with "Classes.lua" !
Forums overviewCS2D overview Scripts overviewLog in to reply

English Some trouble with "Classes.lua" !

5 replies
To the start Previous 1 Next To the start

old Some trouble with "Classes.lua" !

phihung940
User Off Offline

Quote
I'm working with "Classes.lua" - The basic (original) .lua file. Then I got the problems. I realy need help with this
1) I want each class are carry only 1 melee only !
2) After I add some new class (9 playable class - the origin is 6), the BOT are only play with first class. Why ?
3) How to make Medic class healing the other class/player ?

Thank you, hope you guys help me!

old Re: Some trouble with "Classes.lua" !

phihung940
User Off Offline

Quote
Spoiler >

old Re: Some trouble with "Classes.lua" !

Parallel_Man
BANNED Off Offline

Quote
user phihung940 has written
1) I want each class are carry only 1 melee only !
!

That's easy. You need to change the weapon IDs in the place I quoted below, although I'm not sure.
user phihung940 has written
     -- SOLDIER
     if (sample.classes.class[id]==2) then
          parse ("setmaxhealth "..id.." 200")
          parse ("setarmor "..id.." 50")
          parse ("speedmod "..id.." -3")
          return "11,47,51";
     end

user phihung940 has written
          return "11,47,51";

These are weapon IDs. But I may be wrong.

old Re: Some trouble with "Classes.lua" !

EngiN33R
Moderator Off Offline

Quote
1) Add
1
parse("strip "..id.." 50")
at the very end of the spawn hook:
1
2
3
4
5
6
7
-- SPY
     if (sample.classes.class[id]==9) then
          parse ("setmaxhealth "..id.." 150")
          return "84,3,69,52";
     end
     parse("strip "..id.." 50")
end

2) The bots aren't that intelligent to select classes from the menu themselves. Add this at the end of the script before the line where we strip knives:
1
2
3
4
if (player(id,"bot")) then
	sample.classes.class[id]=math.random(1,9) --select random class
	parse("killplayer "..id) --kill bot to change class
end

3)
1
2
3
4
5
6
addhook("hit","hitcomp")
function hitcomp(id,src,w)
	if (w==22 and player(id,"team")==player(src,"team")) then
		parse("sethealth "..src.." "..(player(src,"health")+1)) --change the amount of health healed if you want
	end
end

All of the above should work.

@Parallel_Man
Why are you writing here if you're so not sure?
edited 1×, last 13.08.11 12:06:48 pm

old Re: Some trouble with "Classes.lua" !

phihung940
User Off Offline

Quote
@EngiN33R: BIG THANKS FOR YOU DUDE !!! ok... 1 and 2 are done, but the number 3. I can't understand how the healing works @-). Can you make the Medic healing AoE (96 x96 Pixel) ?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview