Forum

> > CS2D > Scripts > collect script won't work
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch collect script won't work

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt collect script won't work

En-Kay
User Off Offline

Zitieren
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.

alt Re: collect script won't work

Apache uwu
User Off Offline

Zitieren
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?

alt Re: collect script won't work

En-Kay
User Off Offline

Zitieren
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.
1× editiert, zuletzt 21.07.12 21:43:32

alt Re: collect script won't work

En-Kay
User Off Offline

Zitieren
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.

alt Re: collect script won't work

omg
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht