Forum

> > CS2D > Scripts > Need Table Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need Table Script

5 replies
To the start Previous 1 Next To the start

old Need Table Script

Ridho
User Off Offline

Quote
Hi, I'm sorry if I make a same post with the other post or whatever, I've searched the thread with "Tab / Table" keyword but I don't find what I need
~skip this

I need the table script, I just do "trial and error" and I finally I found this, but Idk if this is a table or no,. like this:
1
pistol={1,2,3,4,5,6}

then in the kill hook, If I kill an enemy with the weapon ID mentioned above, I will get the point,

I have made this but when I kill an enemy with weapon except "pistol" it will also adds the point of pistol:

1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("kill","test")
function test(id)
pistolpercent=level[id]*5
wep=player(id,"weapontype")
if wep==pistol then
epistol[id]=epistol[id]+math.random(1,2)
if pistol[id]>=pistolpercent then
epistol[id]=epistol[id]-pistolpercent
lpistol[id]=lpistol[id]+1
msg2(id,"©000255000Pistol Skill Leveled Up!@C")
end
end
end

Im sorry If I type the wrong text, because Im using handphone lol, and I hope you understand what I mean, thanks

old Re: Need Table Script

Ajmin
User Off Offline

Quote
1
2
3
4
5
6
7
8
pistol={1,2,3,4,5,6}
addhook("kill","test")
function test(id)
wep=player("weapontype")
if wep==pistol[id] then
msg2(id,"©000255000Pistol Skill Leveled Up!@C")
end
end

Hope i helped.

also insert ur lvl up codes here!
edited 1×, last 12.12.14 02:23:02 pm

old Re: Need Table Script

Joni And Friends
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pistol={1,2,3,4,5,6}
addhook("kill","test")
function test(id)
pistolpercent=level[id]*5
wep=player(id,"weapontype")
for g=1,#pistol do
if wep==pistol[g] then
epistol[id]=epistol[id]+math.random(1,2)
if epistol[id]>=pistolpercent then
epistol[id]=epistol[id]-pistolpercent
lpistol[id]=lpistol[id]+1
msg2(id,"©000255000Pistol Skill Leveled Up!@C")
end
end
end
end
Sorry if the code not working, im using phone too
edited 4×, last 12.12.14 10:36:45 am

old Re: Need Table Script

eledah
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
pistol = {1, 2, 3, 4, 5, 6}
addhook('kill', '_kill')
function _kill(id)
	local wep = player(id, 'weapontype')
	for i = 1, #pistol do
		if wep == pistol[i] then
			-- Someone is killed with a pistol
			-- Add your LVLUP stuff here
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview