H
Size: a a a
H
ВЗ
S
H
S
H
S
sudo apt-get install luarocks
sudo luarocks install luasocket
sudo luarocks install luasecH
sudo apt-get install luarocks
sudo luarocks install luasocket
sudo luarocks install luasecS
H
S
S
local set = {
a = true,
b = true,
foo = true
}
if set.foo then ... endF
emergency = {['78232'] = true, ['7823'] = true, ['7825'] = true}
local lactac = '7823'
if emergency[lactac] then
print "true"
else
print "false"
endS
S
emergency ='78232','7823','7825'
local lactac = '7823'
if emergency[lactac] then
print "true"
else
print "false"
endemergency это не таблица. Ты присваиваешь ей строку '78232'. Вообще, оно должно было бы упасть, но не падает потому что у строк есть ключи-строковые методы чтобы можно было делать:str = "foo"
print(str:find("o")) --> 2 2
Поэтому у строк как бы можно пытаться взять ключ, но это бесполезно.F
local set = {
a = true,
b = true,
foo = true
}
if set.foo then ... end
S
set[lactac]. Ты ведь пытаешься выдрать по значению переменной. set.lactac == set['lactac'], что совсем не set['foo'], оно же set.foo.S