Forum

> > CS2D > Scripts > Buy menu doesn't work at all.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Buy menu doesn't work at all.

2 replies
To the start Previous 1 Next To the start

old Buy menu doesn't work at all.

D-D3ADxPro
User Off Offline

Quote
I tried to see other threads about this, but none of them helped me. Im using EP's buy menu script, which I edited.

Heres a full script:
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
--------------------------------
-- Sparta Script 			  --
-- By D-D3ADxPro 			  --
-- Thanks For Downloading! :) --
--------------------------------

------------------------------
-- Basic Functions 			--
------------------------------

addhook("serveraction","spartabuymenu")
function spartabuymenu(id,act)
if act==3 then
menu(id,"Sparta Buy Menu,Swords,Tactical Shields,Armor,Others")
	end
end

addhook("menu","buymenu")
function buymenu(id,title,buton)
if title=="Sparta Buy Menu" then
if buton==1 then
menu(id,"Sparta Swords,Wooden Sword|$1000,Iron Sword|$3500,Fire Sword|$6500,Diamond Sword|$8500,Golden Sword|$12000")
elseif buton==2 then
menu(id,"Sparta Shields,Wooden Shield|$700,Iron Shield|$2500,Fire Shield|$4000,Diamond Shield|$7000,Poisonous Shield|$9500,Golden Shield|$12550")
elseif buton==3 then
menu(id,"Sparta Armor,65 AP|$250,100 AP|$700,Weak Armor|$2500,Normal Armor|$4550,Hard Armor|$6000,Extreme Armor|$12000")
elseif buton==4 then
menu(id,"Sparta Others,Snowballs|$1200,Sachel Charges|$2500,Stick Bombs|$3500,Crossbow|$4500")
end
end

In console it just shows this:
1
LUA ERROR: maps/cs_italy:30: 'end' expected (to close 'if' at line 20) near '<eof'>

I tried to change up things, but they don't work at all.

old Re: Buy menu doesn't work at all.

limonata
User Off Offline

Quote
Here: / And put tabs to your code lines. Like mine.

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
--------------------------------
-- Sparta Script                  --
-- By D-D3ADxPro                  --
-- Thanks For Downloading! :) --
--------------------------------

------------------------------
-- Basic Functions                --
------------------------------

addhook("serveraction","spartabuymenu")
function spartabuymenu(id,act)
	if act==3 then
		menu(id,"Sparta Buy Menu,Swords,Tactical Shields,Armor,Others")
    end
end

addhook("menu","buymenu")
function buymenu(id,title,buton)
	if title=="Sparta Buy Menu" then
		if buton==1 then
			menu(id,"Sparta Swords,Wooden Sword|$1000,Iron Sword|$3500,Fire Sword|$6500,Diamond Sword|$8500,Golden Sword|$12000")
		elseif buton==2 then
			menu(id,"Sparta Shields,Wooden Shield|$700,Iron Shield|$2500,Fire Shield|$4000,Diamond Shield|$7000,Poisonous Shield|$9500,Golden Shield|$12550")
		elseif buton==3 then
			menu(id,"Sparta Armor,65 AP|$250,100 AP|$700,Weak Armor|$2500,Normal Armor|$4550,Hard Armor|$6000,Extreme Armor|$12000")
		elseif buton==4 then
			menu(id,"Sparta Others,Snowballs|$1200,Sachel Charges|$2500,Stick Bombs|$3500,Crossbow|$4500")
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview