Forum

> > CS2D > Scripts > Need Table Script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Need Table Script

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Need Table Script

Ridho
User Off Offline

Zitieren
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

alt Re: Need Table Script

Ajmin
User Off Offline

Zitieren
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!
1× editiert, zuletzt 12.12.14 14:23:02

alt Re: Need Table Script

Joni And Friends
User Off Offline

Zitieren
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
4× editiert, zuletzt 12.12.14 10:36:45

alt Re: Need Table Script

eledah
User Off Offline

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