Forum

> > CS2D > Scripts > collect script won't work
Forums overviewCS2D overview Scripts overviewLog in to reply

English collect script won't work

8 replies
To the start Previous 1 Next To the start

old collect script won't work

En-Kay
User Off Offline

Quote
I have a problem.This script doesn't work and i don't know why.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
addhook ("collect","armor")
function armor(id,iid,type,ain,a,mode)
	if type==58 then
	if (sample.classes.class[id]==1) then
		parse ("setarmor "..id.." 50")
		parse ("equip "..id.." 61")
		parse ("equip "..id.." 62")
		parse ("equip "..id.." 64")
		parse ("setmoney "..id.." "..player(id,"money")+2000)

    elseif (sample.classes.class[id]==2) then
		parse ("setarmor "..id.." 200")
		parse ("equip "..id.." 61")
		parse ("equip "..id.." 62")
		parse ("equip "..id.." 64")
		parse ("setmoney "..id.." "..player(id,"money")+2000)

    elseif (sample.classes.class[id]==3) then
		parse ("setarmor "..id.." 50")
		parse ("equip "..id.." 61")
		parse ("equip "..id.." 62")
		parse ("equip "..id.." 64")
		parse ("setmoney "..id.." "..player(id,"money")+2000)

    elseif (sample.classes.class[id]==4) then
		parse ("setarmor "..id.." 120")
		parse ("equip "..id.." 61")
		parse ("equip "..id.." 62")
		parse ("equip "..id.." 64")
		parse ("setmoney "..id.." "..player(id,"money")+2000)

    elseif (sample.classes.class[id]==6) then
	        parse ("setarmor "..id.." 200")
		parse ("equip "..id.." 61")
		parse ("equip "..id.." 62")
		parse ("equip "..id.." 64")
		parse ("setmoney "..id.." "..player(id,"money")+2000)

    elseif (sample.classes.class[id]==7) then
		parse ("setarmor "..id.." 120")
		parse ("equip "..id.." 61")
		parse ("equip "..id.." 62")
		parse ("equip "..id.." 64")
		parse ("setmoney "..id.." "..player(id,"money")+2000)

    elseif (sample.classes.class[id]==8) then
		parse ("setarmor "..id.." 50")
		parse ("equip "..id.." 61")
		parse ("equip "..id.." 62")
		parse ("equip "..id.." 64")
		parse ("setmoney "..id.." "..player(id,"money")+2000)
		end
	end
end

I made similar script which is like when i collect an item with different class i get different item and that one works but this one doesn't.Please help.

old Re: collect script won't work

Apache uwu
User Off Offline

Quote
I don't quite get this, if you walkover (yeah use the walkover hook) a kevlar+helm item, then depending on your class you are equipped with different items?

Shouldn't this be on the cs2d lua hook spawn?

old Re: collect script won't work

En-Kay
User Off Offline

Quote
I found the problem.Actually the problem is in the lua file (this is the part of it).I accidently wrote a letter in front of comment so it didn't work.Anyway thanks for help.


P.S.


You are right,but when my armor is damaged and when i collect kevlar i do get different amount of armor for different class.
edited 1×, last 21.07.12 09:43:32 pm

old Re: collect script won't work

En-Kay
User Off Offline

Quote
The collect hook is used when you collect item (something like that).


P.S.


I am making team fortress classic 2D and im nearly done.

I have added all 9 classes,making bots choose differnet class,making bots choose different weapons,added backpack which gives primary,secondary and 100 money,added kevlar like armor which gives full health,armor,ammo and 2000 money and added grenade backpack which rerplenishes grenades depending on class.

old Re: collect script won't work

omg
User Off Offline

Quote
i usually just use the walkover hook all the time because it gives more control over the looting and is basically better than collect in every way
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview