Forum

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

English glow lua error

13 replies
To the start Previous 1 Next To the start

old glow lua error

hunter139
User Off Offline

Quote
hi
i have this glow lua made by a friend
so it has an error

1- everything goes well in the beginning, when say !glow the menu appears
2-when click on next page, the menu closes and i have this error in console


any help ?

old Re: glow lua error

hunter139
User Off Offline

Quote
oh i forgot
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
----------------------------------------------------
							-------Simple Glow Script By Karim Patron-----------
							----------------------------------------------------
							-------USGN : 113769--------------------------------
							----------------------------------------------------
							-------based on say, not serveraction---------------
							----------------------------------------------------
							-------incompleted yet (ERROR: page 2 don't appear)-
							----------------------------------------------------
							-------More Colors----------------------------------
							----------------------------------------------------
							-------Done on 20/8/2013----------------------------
							----------------------------------------------------

addhook("say","glow")
function glow(id,txt)
	if txt == "!glow" then
		menu (id,"Glow Menu (Page 1/2),Glow Red,Glow Green,Glow Blue,Glow Yellow,Glow Orange,Glow Brown,Glow Pink,Glow Violet,---> Next Glow Page")
	end
end

addhook("menu","glow2")
function glow2(id,menu,buton)
	if menu=="Glow Menu (Page 1/2)" then
		if buton==9 then
			menu (id,"Glow Menu (Page 2/2),Glow Light Blue,Glow Dark Blue,Glow Light Green,Glow Dark Green,Glow White,Glow Black,Remove The Glow,<--- Previous Glow Page ")
		end
	elseif menu=="Glow Menu (Page 2/2)" then
		if buton==8 then
			menu (id,"Glow Menu (Page 2/2),Glow Light Blue,Glow Dark Blue,Glow Light Green,Glow Dark Green,Glow White,Glow Black,Remove The Glow,<--- Previous Glow Page ")
		end
	end
end

addhook("menu","glowcolour")
function glowcolour(id,menu,buton)
	if menu=="Glow Menu (Page 1/2)" then
		if buton == 1 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,255,0,0)
		end
	end

	if menu=="Glow Menu (Page 1/2)" then
		if buton == 2 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,0,255,0)
		end
	end

	if menu=="Glow Menu (Page 1/2)" then
		if buton == 3 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,0,0,255)
		end
	end

	if menu=="Glow Menu (Page 1/2)" then
		if buton == 4 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,255,255,0)
		end
	end

	if menu=="Glow Menu (Page 1/2)" then
		if buton == 5 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,255,128,0)
		end
	end

	if menu=="Glow Menu (Page 1/2)" then
		if buton == 6 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,153,76,0)
		end
	end

	if menu=="Glow Menu (Page 1/2)" then
		if buton == 7 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,255,51,153)
		end
	end

	if menu=="Glow Menu (Page 1/2)" then
		if buton == 8 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,255,0,255)
		end
	end

	if menu=="Glow Menu (Page 2/2)" then
		if buton == 1 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,0,255,255)
		end
	end

	if menu=="Glow Menu (Page 2/2)" then
		if buton == 2 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,000,000,153)
		end
	end

	if menu=="Glow Menu (Page 2/2)" then
		if buton == 3 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,153,255,51)
		end
	end

	if menu=="Glow Menu (Page 2/2)" then
		if buton == 4 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,0,153,0)
		end
	end

	if menu=="Glow Menu (Page 2/2)" then
		if buton == 5 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,255,255,255)
		end
	end

	if menu=="Glow Menu (Page 2/2)" then
		if buton == 6 then
			freeimage(id)
			id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagescale(id1,1,1)
			imageblend(id1,1)
			imagealpha(id1,0.7)
			imagecolor(id1,0,0,0)
		end
	end

	if menu=="Glow Menu (Page 2/2)" then
		if buton == 7 then
			freeimage(id)
		end
	end
end

old Re: glow lua error

Patron14
User Off Offline

Quote
i told you it is incomplete, why post it in forum

i dont know where the mistake :

old Re: glow lua error

hunter139
User Off Offline

Quote
i want start my server and i dont have time to wait for you to fix it, you are going to fix it only after 1 week, i need good scripters to do it

i will PM you later ...

old Re: glow lua error

Alistaire
User Off Offline

Quote
menu() is a function, but the dude uses it to save the "title" parameter from the menu hook.

old Re: glow lua error

Dovahkin
User Off Offline

Quote
Spoiler >


I can't paste the code in the code section. I don't know why. Soo, I'm sorry moderators.

old Re: glow lua error

MikuAuahDark
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
addhook("menu","glow2")
function glow2(id,menu,buton)
     if menu=="Glow Menu (Page 1/2)" then
          if buton==9 then
               menu (id,"Glow Menu (Page 2/2),Glow Light Blue,Glow Dark Blue,Glow Light Green,Glow Dark Green,Glow White,Glow Black,Remove The Glow,<--- Previous Glow Page ")
          end
     elseif menu=="Glow Menu (Page 2/2)" then
          if buton==8 then
               menu (id,"Glow Menu (Page 2/2),Glow Light Blue,Glow Dark Blue,Glow Light Green,Glow Dark Green,Glow White,Glow Black,Remove The Glow,<--- Previous Glow Page ")
          end
     end
end

local variable has higher priority than global variable.
Fixed:
1
2
3
4
5
6
7
8
9
10
11
12
addhook("menu","glow2")
function glow2(id,menu,buton)
     if menu=="Glow Menu (Page 1/2)" then
          if buton==9 then
               _G.menu (id,"Glow Menu (Page 2/2),Glow Light Blue,Glow Dark Blue,Glow Light Green,Glow Dark Green,Glow White,Glow Black,Remove The Glow,<--- Previous Glow Page ")
          end
     elseif menu=="Glow Menu (Page 2/2)" then
          if buton==8 then
               _G.menu (id,"Glow Menu (Page 2/2),Glow Light Blue,Glow Dark Blue,Glow Light Green,Glow Dark Green,Glow White,Glow Black,Remove The Glow,<--- Previous Glow Page ")
          end
     end
end

old Re: glow lua error

Avo
User Off Offline

Quote
Example >

How about changing local "menu" to something like "title"?

old Re: glow lua error

MikuAuahDark
User Off Offline

Quote
user Avo has written
How about changing local "menu" to something like "title"?

on my opinion, it's better to use _G global variable that holds all global variables. so using _G.cs2d lua cmd menu is same as cs2d lua cmd menu(when local variable menu is not exist). you also only need to add 3 characters and it's less confusing.

old Re: glow lua error

Avo
User Off Offline

Quote
For someone who's new to lua scripting, it's not less confusing. But right, it's also proper.

old removed error

pbeloto
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
addhook("say","glow")
function glow(id,txt)
    if txt == "!glow" then
          menu (id,"Glow Menu (Page 1/2),Glow Red,Glow Green,Glow Blue,Glow Yellow,Glow Orange,Glow Brown,Glow Pink,Glow Violet,---> Next Glow Page")
	return 1
     end
end

addhook("menu","_menu")
function _menu(id,title,buton)
-- MENU GLOW PAGE 1 --
     if title=="Glow Menu (Page 1/2)" then
			if buton == 1 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,255,0,0)
        elseif buton == 2 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,0,255,0)
        elseif buton == 3 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,0,0,255)
        elseif buton == 4 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,255,255,0)
        elseif buton == 5 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,255,128,0)
        elseif buton == 6 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,153,76,0)
        elseif buton == 7 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,255,51,153)
        elseif buton == 8 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,255,0,255)
		elseif buton == 9 then
		menu(id,"Glow Menu (Page 2/2),Glow Light Blue,Glow Dark Blue,Glow Light Green,Glow Dark Green,Glow White,Glow Black,Remove The Glow,<--- Previous Glow Page ")
          end
     end
-- MENU GLOW PAGE 2 --
     if title=="Glow Menu (Page 2/2)" then
			if buton == 1 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,0,255,255)
        elseif buton == 2 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,000,000,153)
        elseif buton == 3 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,153,255,51)
        elseif buton == 4 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,0,153,0)
        elseif buton == 5 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,255,255,255)
        elseif buton == 6 then
               freeimage(id)
               id1=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagescale(id1,1,1)
               imageblend(id1,1)
               imagealpha(id1,0.7)
               imagecolor(id1,0,0,0)
        elseif buton == 7 then
               freeimage(id)
		elseif buton == 8 then
		menu (id,"Glow Menu (Page 1/2),Glow Red,Glow Green,Glow Blue,Glow Yellow,Glow Orange,Glow Brown,Glow Pink,Glow Violet,---> Next Glow Page")
          end
     end
end

Don't Tested, error pm me ok?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview