Forum

> > CS2D > Scripts > Please make lua!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Please make lua!

11 replies
To the start Previous 1 Next To the start

old Please make lua!

Obviously Exactly Myself
User Off Offline

Quote
When you're a terrorist then you move in a specific tile you will receive something ONCE:
$2500
3 score
can't get off that spot
invulnerable in that spot
X=8 Y=74

When you're a terrorist then you use in a specific tile you will receive something ONCE:
$5000
3 score
X=279 Y=5

Spoiler >
edited 1×, last 19.11.11 10:23:50 am

old Re: Please make lua!

Kel9290
User Off Offline

Quote
i idk what you mean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
spot = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}

addhook('movetile','_mt')
function _mt(i,x,y)
	if x == 8 and y == 74 then
		msg2(i,'$2500, 3 score')
		spot[i] == 1
		parse('speedmod '..i..' 0')
	elseif x == 279 and y == 5 then
		msg2(i,'$5000, 3 score')
		spot[i] == 1
		parse('speedmod '..i..' 0')
	end
end

addhook('hit','_h')
function _h(i)
	if spot[i] == 1 then
		return 1
	end
end

old Re: Please make lua!

MikuAuahDark
User Off Offline

Quote
maybe you will understand this script and this script not error
More >

i hope i don't make any errors

old Re: Please make lua!

mafia_man
User Off Offline

Quote
Don't listen to newbies
Here's your code.
Spoiler >

old Re: Please make lua!

DannyDeth
User Off Offline

Quote
@user Obviously Exactly Myself:
Meh.
1
2
3
4
5
6
addhook("movetile","check_score_tiles")
function check_score_tiles(id,x,y)
	if( ( x == 8 and y == 74 ) or ( x == 279 and y == 5 ) ) then
		parse("setscore "..id.." "..(player(id,"score")+3))
	end
end

old Re: Please make lua!

Obviously Exactly Myself
User Off Offline

Quote
user mafia_man has written
Don't listen to newbies
Here's your code.
Spoiler >


It works! Except I don't wan't a message so I removed it but the use one doesn't work and when you re-spawn ur still in 8x74.

old Re: Please make lua!

Informatixa
User 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
33
34
35
36
37
38
39
40
int0 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
int1 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}

addhook('join','onJoin')
function onJoin(i)
	int0[i] = 0
	int1[i] = 0
end

addhook('movetile','onMoveTile')
function onMoveTile(i, x, y)
	if player(i, 'team') == 1 then
		if x == 8 and y == 74 then
			int1[i] = 1

			if int0[i] == 0 then
				int0[i] = 1

				parse('setscore '.. i ..' '.. (player(i, 'score') + 3))
				parse('setmoney '.. i ..' '.. (player(i, 'money') + 2500))
			end
		elseif x == 279 and y == 5 then
			if int0[i] == 0 then
				int0[i] = 1

				parse('setscore '.. i ..' '.. (player(i, 'score') + 3))
				parse('setmoney '.. i ..' '.. (player(i, 'money') + 5000))
			end
		else
			int1[i] = 0
		end
	end
end

addhook('hit','onHit')
function onHit(i)
	if int1[i] == 1 then
		return 1
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview