Jump to content
  • 0

pls explain me this script


Cornysz

Question

local a = gg.choice({'Lang 1','Lang 2'})

if a == nil then os.exit() end

local lang = {

{ -- lang 1

['hi'] = 'Hi',

},

{ -- lang 2

['hi'] = 'Hello',

},

}

lang = lang[a]

print(lang['hi'])

 

this script is from enyby, i try to understand this but still confused argh :/ Can someone explain me about this script? And can anyone give me another example but related from this script

ty in advance

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • Administrators

You can write same as:

local a = gg.choice({'Lang 1','Lang 2'})
if a == nil then os.exit() end
if a == 1 then
	lang = { -- lang 1
		['hi'] = 'Hi',
	}
end
if a == 2 then
	lang = { -- lang 2
		['hi'] = 'Hello',
	}
end
print(lang['hi'])

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.