Today I met another interesting problem at lua.
I made a button, when you click on it, you will see your level, experience, etc.
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
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
addhook("attack","dead_attack") function dead_attack(idt) 	if xe[idt] > 188 and ye[idt] > 229 and xe[idt] < 200 and ye[idt] < 240 and profile_b[idt] == 1 then 		freeimage(expmenuimageq[idt]) 		expmenuimageq[idt] = 0 		freeimage(expmenuimagex[idt]) 		expmenuimagex[idt] = 0 		profile_b[idt] = 0 		parse('hudtxt2 "..idt.." 20 "©255000000|\169255255255PROFILE" 20 140 0') 		parse('hudtxt2 "..idt.." 7 "" 20 240 0') 		parse('hudtxt2 "..idt.." 8 "" 20 260 0') 		parse('hudtxt2 "..idt.." 9 "" 60 280 1') 		freeimage(userbarimageb[idt]) 		userbarimageb[idt] = 0 		freeimage(userbarimagesb[idt]) 		userbarimagesb[idt] = 0 		freeimage(userbutton1[idt]) 		userbutton1[idt] = 0 		freeimage(userbutton2[idt]) 		userbutton2[idt] = 0 	elseif xe[idt] > 21 and ye[idt] > 141 and xe[idt] < 78 and ye[idt] < 151 and profile_b[idt] == 0 then 		parse('hudtxt2 "..idt.." 20 "" 20 140 0') 		profile_b[idt] = 1 		expmenuimageq[idt] = image("gfx/dead_by_daylight/lua/exp_menu.png",100,265,2,idt) 		expmenuimagex[idt] = image("gfx/dead_by_daylight/lua/menu_x.png",195,236,2,idt) 		if player(idt,"team") == 2 then 			parse('hudtxt2 "..idt.." 7 "©255000000SURVIVOR PROFILE" 20 240 0') 			parse('hudtxt2 "..idt.." 8 "©255255255LEVEL \169255000000'..level_s[idt]..'" 20 260 0') 			parse('hudtxt2 "..idt.." 9 "©255255255'..exp_s[idt]..'/'..maxexp_s[idt]..'" 85 280 1') 			userbarimageb[idt] = image("gfx/dead_by_daylight/lua/hud.png",21,287,2,idt) 			userbarimagesb[idt] = image("gfx/dead_by_daylight/lua/bar.png",21,287,2,idt) 			imagescale(userbarimageb[idt],exp_s[idt]/maxexp_s[idt],1) 			userbutton1[idt] = image("gfx/dead_by_daylight/lua/inventory_but.png",45,319,2,idt) 			imagescale(userbutton1[idt],0.3,0.3) 			userbutton2[idt] = image("gfx/dead_by_daylight/lua/bloodweb_but.png",95,319,2,idt) 			imagescale(userbutton2[idt],0.3,0.3) 		elseif player(idt,"team") == 1 then 			parse('hudtxt2 "..idt.." 7 "©255000000KILLER PROFILE" 20 240 0') 			parse('hudtxt2 "..idt.." 8 "©255255255LEVEL \169255000000'..level[idt]..'" 20 260 0') 			parse('hudtxt2 "..idt.." 9 "©255255255'..exp[idt]..'/'..maxexp[idt]..'" 85 280 1') 			userbarimageb[idt] = image("gfx/dead_by_daylight/lua/hud.png",21,287,2,idt) 			userbarimagesb[idt] = image("gfx/dead_by_daylight/lua/bar.png",21,287,2,idt) 			imagescale(userbarimageb[idt],exp[idt]/maxexp[idt],1) 			userbutton1[idt] = image("gfx/dead_by_daylight/lua/inventory_but.png",45,319,2,idt) 			imagescale(userbutton1[idt],0.3,0.3) 			userbutton2[idt] = image("gfx/dead_by_daylight/lua/bloodweb_but.png",95,319,2,idt) 			imagescale(userbutton2[idt],0.3,0.3) 		end 	end end
The problem is, when I click on button at first cs2d(ID 1), I can see texts on second cs2d(ID 2) too. But the images works well(I can see them only first cs2d(ID 1)). Probably, a lot of people will see this problem first time in their entire life. Maybe It does not work for because of a small mistake, idk.
Please, help me guys.
edited 1×, last 29.06.16 11:53:04 pm