Forum

> > CS2D > Scripts > Lua Scipt For Diablo
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scipt For Diablo

2 replies
To the start Previous 1 Next To the start

old Lua Scipt For Diablo

Lotteria
User Off Offline

Quote
Hi everybody.Somebody can give me a lua script when i buy weapon , I will have them forever
Ex:i buy a He ,I died and next time i respawn i still have a He
I need a lua because I am modding diablo mod for cs2d now i have a lua kill NPC money , LV-exp , .....Now i just need a lua
"when i buy weapon , I will have them forever" to complete my mod Plz help me.thanks you.

old Re: Lua Scipt For Diablo

Ultimate programmer
BANNED Off Offline

Quote
Gm i can help you.
put this script to lua file and write it's name in options
:
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
--------------------------------------------------------------------------------
--Diablo  script  for CS2D  by Ultimate Software          --
--Beta 1	26.06.2011 00:00								      --
--------------------------------------------------------------------------------

if sample==nil then sample={} end
diablo={}

function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

he=initArray(32)
--add where name of weapon example: 
--m4a1=initArray(32) 
--ak47=initArray(32)
--( "--" is comment!!!)

addhook("buy","diablo_buy")
function diablo_buy(pl,weapon)
	if weapon==51 then
	parse("killplayer "..pl)
	he[pl]=1
	--add where number(id) of weapon(see it in map editor)
	--example:
	--elseif weapon==34 then
	--parse("killplayer "..pl)
	--m4a1[pl]=1
	--elseif weapon==33 then
	--parse("killplayer "..pl)
	--ak47[pl]=1
	end
end

addhook("spawn","diablo_spawn")
function diablo_spawn(pl)
	if he[pl]==1 then
	parse("equip "..pl.." 51")
	he[pl]=0
	--write where as it writen in example:
	--elseif m4a1[pl]==1 then
	--parse("equip "..pl.." 34")
	--m4a1[pl]=0                 L_______the number(id) of weapon
	--elseif ak47[pl]==1 then
	--parse("equip "..pl.." 35")
	--ak47[pl]=0                  L_______the number(id) of weapon
	end
end

and I can give you 13 my maps of diablo-I also made it!

old Re: Lua Scipt For Diablo

Lotteria
User Off Offline

Quote
OMG Good Guy Thanks you so much
I use Lua script weapon shop sytem and NPC money to make this mod ...again! thanks you so much
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview