English Why not working lua?

3 replies
Goto Page
To the start Previous 1 Next To the start
11.08.18 02:54:41 pm
Up
Hi, i created a lua but lua is cant working:(

Code:
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
admin = {142925}
addhook("say","lol") 

function lol(id,txt)
if txt == "!color" then 
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
return 1
end
for _, usgn in ipairs(admin) do 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©250250000 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©250250000 "..txt)
return 1
end
end
end

addhook("menu","sa")
function sa(id,title,buton)
for _, usgn in ipairs(admin) do
if txt == "!color" then 
if buton == 1 then 
menu(id,"Red")
elseif buton == 2 then 
menu(id,"Blue")
elseif buton == 3 then 
menu(id,"White")
elseif buton == 4 then 
menu(id,"Cyan")
elseif buton == 5 then 
menu(id,"Orange")
elseif buton == 6 then
menu(id,"Green")
elseif buton == 7 then 
menu(id,"Turquaz")
elseif buton == 8 then 
menu(id,"Pink")
end 
end
if title == "Red" then ------------------------
if buton == 1 then 
menu(id,"Red,Red,Back")
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
if title == "Blue" then -----
if buton == 1 then 
menu(id,"Blue,Blue,Back")
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
if title == "White" then -----
if buton == 1 then 
menu(id,"White,White,Back")
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
if title == "Cyan" then 
if buton == 1 then 
menu(id,"Cyan,Cyan,Back")
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
if title == "Orange" then 
if buton == 1 then 
menu(id,"Orange,Orange,Back")
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
if title == "Green" then 
if buton == 1 then 
menu(id,"Green,Green,Back")
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
if title == "Turquaz" then 
if buton == 1 then 
menu(id,"Turquaz,Turquaz,Back")
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
if title == "Pink" then 
if buton == 1 then 
menu(id,"Pink,Pink,Back")
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
if title == "Red" then 
if buton == 1 then 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©255000000 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©255000000 "..txt)
return 1
end
if buton == 2 then 
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
if title == "Blue" then 
if buton == 1 then 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©000128255 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©000128255 "..txt)
end
if buton == 2 then 
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
if title == "White" then 
if buton == 1 then 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©255255255 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©255255255 "..txt)
return 1
end
if buton == 2 then 
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
if title == "Cyan" then 
if buton == 1 then 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©100200300 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©100200300 "..txt)
return 1
end
if buton == 2 then
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
if title == "Orange" then 
if buton == 1 then 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©229076009 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©229076009 "..txt)
return 1
end
if buton == 2 then 
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
if title == "Green" then 
if buton == 1 then 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©000250000 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©000250000 "..txt)
return 1
end
if buton == 2 then 
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
if title == "Turquaz" then 
if buton == 1 then 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©100200300 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©100200300 "..txt)
return 1
end
if buton == 2 then 
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
if title == "Pink" then 
if buton == 1 then 
if player(id,"team") == 1 then 
msg("[Admin]: ©255025000"..player(id,"name").." :©100200300 "..txt)
return 1
end
if player(id,"team") == 2 then 
msg("[Admin]: ©000128255"..player(id,"name").." :©100200300 "..txt)
return 1
end
if buton == 2 then 
menu(id,"ColorMenu,Red,Blue,White,Cyan,Orange,Green,Turquaz,Pink")
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
11.08.18 03:05:32 pm
Up
LoaderFRA
User
Offline Off
Need TAB your code and you code is:
Code:
1
2
3
4
if...
if...
if...
if...

Add else elseif your code is wrong.
Believe in your dreams and never give up.
11.08.18 03:54:49 pm
Up
Bowlinghead
User
Offline Off
Code:
1
2
3
4
addhook("menu","sa")
function sa(id,title,buton)
for _, usgn in ipairs(admin) do
if txt == "!color" then

Stop asking for help with no info at all. Explain what your script does/doesnt/should do
Next time POST THIS DAMN red error code in your console!!

txt is undefinded.

Also you create menus with only a headline, better read cs2d lua cmd menu

If a player selects a colour like red, then you gotta save that.
Then if the player writes something then you need this information to manipulate his txt. See cs2d lua hook say
Share time limited free games here
12.08.18 12:57:11 am
Up
KingShadow
User
Offline Off
something like that ??

Spoiler >
edited 1×, last 12.08.18 03:38:52 am
To the start Previous 1 Next To the start