Forum

> > CS2D > Scripts > Button 2 wont work
Forums overviewCS2D overview Scripts overviewLog in to reply

English Button 2 wont work

2 replies
To the start Previous 1 Next To the start

old Button 2 wont work

Dovahkin
User Off Offline

Quote
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
function Array(size,value)
	local array = {}
	for i = 1, size do
		array[i]=value
	end
	return array
end


Dukespeak = Array(32,0)
Duketold = Array(32,0)
Dukebuy = Array(32,0)



addhook("use","shop")
function shop(id,event,data,x,y)
	if (x == 3 and y == 5) then							

		menu(id,"Duke@b,Ask on whats the rules,Ask on how to open door,Do 

Job")
	end
end

addhook("menu","lewl")
function lewl(id,title,button)
	if title == "Duke" then
		if button == 1 then
		if Duketold[id] == 0 then
			msg2(id,"Duke : Hmmmph... Just teamwork -_-")
			Dukespeak[id] = 1
			Duketold[id] = 1
		elseif Duketold[id] == 1 then
			msg2(id,"Duke : I just told you. Wtf? Man.")
			Duketold[id] = 1
			Dukespeak[id] = 0
		elseif button == 2 then
		if Dukebuy[id] == 0 then
			msg2(id,"©255000000Sure ill open it for you, It'll cost you 45$. 

Would you like to buy?")
			menu(id,"Would you like to buy?, Yes (45$ loss), No.")
			Dukebuy[id] = 1
		end
	end
end
end
end
Now is the button 2. It wont work, When i press it. it just go back. Little help?

old Re: Button 2 wont work

ExecL
User Off Offline

Quote
1
2
3
4
5
6
7
addhook("use","shop")
function shop(id,x,y)
	local x,y=player(id,"tilex"),player(id,"tiley")
    if x==3 and y==5 then                                   
		menu(id,"Duke@b,Ask on whats the rules,Ask on how to open door,Do Job")
     end
end

Try this.

old Re: Button 2 wont work

mafia_man
User Off Offline

Quote
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
Dukespeak = {};
Duketold = {};
Dukebuy = {};

addhook("use","shop")
function shop(id, event, data, x, y)
	if (x == 3 and y == 5) then                                   
		menu(id,"Duke@b,Ask on whats the rules,Ask on how to open door,Do Job");
	end
end

addhook("join","onJoin")
function onJoin(id)
	Dukespeak[id] = 0;
	Duketold[id] = 0;
	Dukebuy[id] = 0;
end

addhook("menu","lewl")
function lewl(id,title,button)
	if title == "Duke" then
		if button == 1 then
			if Duketold[id] == 0 then
				msg2(id,"Duke : Hmmmph... Just teamwork -_-")
				Dukespeak[id] = 1
				Duketold[id] = 1
			elseif Duketold[id] == 1 then
				msg2(id,"Duke : I just told you. Wtf? Man.")
				Duketold[id] = 1
				Dukespeak[id] = 0
			end
		elseif button == 2 then
			if Dukebuy[id] == 0 then
				msg2(id,"©255000000Sure ill open it for you, It'll cost you 45$. Would you like to buy?")
				menu(id,"Would you like to buy?, Yes (45$ loss), No.")
				Dukebuy[id] = 1
			end
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview