Forum

> > CS2D > Scripts > Script does not work
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script does not work

7 replies
To the start Previous 1 Next To the start

old Script does not work

Lag Seeing
User Off Offline

Quote
I was making a script when you reach 4 kills your gonna get a Rocket launcher but it doesn't work please help me and tell me if this is Possible or Impossible..
Heres the code:
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
if sample==nil then sample={} end
sample.ut={}

-----------------------
-- INITIAL SETUP     --
-----------------------
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
sample.ut.timer=initArray(32)
sample.ut.level=initArray(32)
sample.ut.fblood=0


-----------------------
-- KILL SOUNDS+MSGS  --
-----------------------
addhook("kill","sample.ut.kill")
function sample.ut.kill(killer,victim,weapon)
	if (os.clock()-sample.ut.timer[killer])>5 then
		sample.ut.level[killer]=0;
        end
        level=sample.ut.level[killer]
	level=level+1
	sample.ut.level[killer]=level
	sample.ut.timer[killer]=os.clock()
        -- REGULAR KILL
        if (level==1) then
               -- Single Kill! Nothing Special!
        elseif (level==2)
               -- Single Kill! Nothing Special!
        elseif (level==3)
               -- Single Kill! Nothing Special!  
        elseif (level==4)
               msg (You killed 4 Players!! You will get a Rocketlauncher!!@C")
               parse('equip '..id..' 48 ')

old Re: Script does not work

MikuAuahDark
User Off Offline

Quote
Fixed script >

untested!
edited 1×, last 29.12.11 10:40:20 am

old Re: Script does not work

EngiN33R
Moderator Off Offline

Quote
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
if sample==nil then sample={} end
sample.ut={}

-----------------------
--   INITIAL SETUP   --
-----------------------
function initArray(m)
    local array = {}
    for i = 1, m do
        array[i]=0
    end
    return array
end
sample.ut.timer=initArray(32)
sample.ut.level=initArray(32)
sample.ut.fblood=0


addhook("kill","sample.ut.kill")
function sample.ut.kill(killer,victim,weapon)
    if (os.clock()-sample.ut.timer[killer])>5 then
        sample.ut.level[killer]=0;
	end
	level=sample.ut.level[killer]
    level=level+1
    sample.ut.level[killer]=level
    sample.ut.timer[killer]=os.clock()
	if (level==4) then
		msg("You killed 4 players! You will get a rocket launcher!@C")
		parse('equip '..id..' 48 ')
	end
end

Not only missing ends, dear Pikachu, but missing thens and missing quotes and many other missing things.

Also, @user Lag Seeing: If I'm not mistaken, the kill count will be reset to 0 if you don't kill for 5 seconds. Do you want it to be so?

EDIT:
Oh, are you fucking kidding me? Since when do we have such fast scripters?

old Re: Script does not work

Lag Seeing
User Off Offline

Quote
Thanks guys for the reply but when i tested it , × didn't work sorry
EDIT:when i turned my back like for 2 minutes 3 replies! so fast!!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview