Forum

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

English lua error!

3 replies
To the start Previous 1 Next To the start

old lua error!

deadlox995
User Off Offline

Quote
i'm was makeing a lua then get this error

LUA ERROR: sys/lua/shop by deadlox.lua:175: 'end' expected (to close 'function' at line 98)


------------------Lua make by Deadlox-----------------
------------------USGN: 121114 & Deadlox995----------

ms={}

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

function ms.moneyshow(id)
	parse('hudtxt2 '..id..' 1 "©255255255Ammo Packs: ©255000000'..ms.money[id]..' " 13 200')
end

addhook ("serveraction","ser")
function ser(id,action)
if player(id,"team")== 1 then
        if action == 1 then
		ms.shopzm(id)
        end
end

function ms.shopzm(id)
	menu(id,"Zombie Shop,GutBomd|5,Armor|10,Chainsaw|15,Zombie madness|20,RPG|50")
end

addhook ("menu","ms.buy")
function ms.buy(id,title,sel)
	if title == "Zombie Shop" then
		if sel == 1 then
			if ms.money[id] > 4 then
				parse("equip "..id.." 86")
				msg2(id,"©000255000You've buy GutBomd!")
				ms.money[id]=ms.money[id]-5
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Packs!")
			end
		end
		if sel == 2 then
			if ms.money[id] > 9 then
				parse("equip "..id.." 80")
				msg2(id,"©000255000You've buy Armor!")
				ms.money[id]=ms.money[id]-10
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Pack!")
			end
		end
		if sel == 3 then
			if ms.money[id] > 14 then
				parse("equip "..id.." 85")
				msg2(id,"©000255000You've buy Chainsaw!")
				ms.money[id]=ms.money[id]-15
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Pack!")
			end
		end
		if sel == 4 then
			if ms.money[id] > 19 then
				parse("setmaxealth "..id.." 250")
                                parse("speedmod "..id.." 6")
				msg2(id,"©000255000You've Zombie madness!")
				ms.money[id]=ms.money[id]-20
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Pack!")
			end
		end
		if sel == 5 then
			if ms.money[id] > 49 then
				parse("equip "..id.." 47")
				msg2(id,"©000255000You've buy RPG!")
				ms.money[id]=ms.money[id]-50
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Packs!")
			end
	   	end
		
	end

addhook ("serveraction","ser2")
function ser2(id,action)
if player(id,"team")== 2 then
        if action == 1 then
		ms.shophm(id)
        end
end

function ms.shophm(id)
	menu(id,"Human Shop,HE|1,Boot Speed|5,Chainsaw|10,Medic Armor|13,FN2000|15")
end

addhook ("menu","ms.buy")
function ms.buy(id,title,sel)
	if title == "human Shop" then
		if sel == 1 then
			if ms.money[id] > 0 then
				parse("equip "..id.." 51")
				msg2(id,"©000255000You've buy HE!")
				ms.money[id]=ms.money[id]-1
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Packs!")
			end
		end
		if sel == 2 then
			if ms.money[id] > 9 then
				parse("speedmod "..id.." 85")
				msg2(id,"©000255000You've buy Chiansaw!")
				ms.money[id]=ms.money[id]-10
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Pack!")
			end
		end
		if sel == 3 then
			if ms.money[id] > 9 then
				parse("equip "..id.." 85")
				msg2(id,"©000255000You've buy Chainsaw!")
				ms.money[id]=ms.money[id]-10
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Pack!")
			end
		end
		if sel == 4 then
			if ms.money[id] > 12 then
				parse("equip "..id.." 83")
                                msg2(id,"©000255000You've buy Medic Armor!")
				ms.money[id]=ms.money[id]-13
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Pack!")
			end
		end
		if sel == 5 then
			if ms.money[id] > 14 then
				parse("equip "..id.." 91")
				msg2(id,"©000255000You've buy FN2000!")
				ms.money[id]=ms.money[id]-15
				ms.moneyshow(id)
			else
				msg2(id,"©255000000You have not enouch Ammo Packs!")
			end
	   	end
		
	end

addhook("spawn","ms.spawn")
function ms.spawn(id)
	ms.moneyshow(id)
end

addhook("kill","ms.kill")
function ms.kill(id)
	ms.money[id]=ms.money[id]+30
	ms.moneyshow(id)
end

addhook("die","ms.die")
function ms.die(id)
	ms.money[id]=ms.money[id]-0
	ms.moneyshow(id)     
end

addhook("minute","minute_shop")
function minute_shop()
	msg("©255255255Have Fun! Thanks For Playing!")
	msg("©000255000Vist Us At ©255255255www.knifeuser.lolbb.com!")
        msg("©000255000LUA make by Deadlox")
end


plz help me!
edited 1×, last 03.04.14 06:48:55 pm

old Re: lua error!

alex72super
User Off Offline

Quote
Well, you could put your code into a code tag:

1
2
3
like this,

It's easier to see the lines
edited 1×, last 03.04.14 09:14:04 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview