Forum

> > CS2D > Scripts > Lua Diablo Its isnt working help me
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Diablo Its isnt working help me

1 reply
To the start Previous 1 Next To the start

old Lua Diablo Its isnt working help me

Lotteria
User Off Offline

Quote
--------------------------------------------------------------------------------
--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





This lua Ultimate programmer it isn wroking
when i buy weapon , I will dont have them forever
Ex:i buy a He ,I died and next time i respawn i dont have a He

old Re: Lua Diablo Its isnt working help me

Apache uwu
User Off Offline

Quote
Well for starters what this script does is...

When you buy a he, it kills you, then when you spawn you have a he. However you will only have it once.

To have the he on EVERY spawn you must run this script instead.

I tabbed it, and removed the comments, also added hook_join, so the he powers won't stay with a player that just joined.

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
--------------------------------------------------------------------------------
--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)

addhook("buy","diablo_buy")

function diablo_buy(pl,weapon)
	if weapon==51 then
		parse("killplayer "..pl)
		he[pl]=1
	end
end

addhook("spawn","diablo_spawn")

function diablo_spawn(pl)
	if he[pl]==1 then
		parse("equip "..pl.." 51")
		--he[pl]=0
	end
end

addhook("join","diablo_join")

function diablo_join(pl)
	he[pl]=0
end

Notice "--he[pl]=0" it means when you spawn it will keep your he capabilities.

Next time, use [code][/code], and make your own luas instead of debugging others.


To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview