LUA identify Language

  • #1, by AndresThursday, 04. June 2020, 05:24 2 years ago
    Hi!

    I hope you´re doing great!

    I´m creating a second language for my game (Spanish/English)

    Is there a way to identify which language is selected in Lua Scripting?

    I want something like this: 

    If Language = Spanish then
    blah
    Else
    Blah
    End If

    Thanks!
    Andrés

    Newbie

    31 Posts


  • #2, by afrlmeThursday, 04. June 2020, 13:35 2 years ago
    Yeah.

    local lang = game.StandardLanguage
    
    
    
    if lang == Languages["English"] then
    
     -- do something
    
    elseif lang == Languages["Spanish"] then
    
     -- do something else
    
    elseif...
    
     -- do something else
    
    else
    
     -- do something else
    
    end

    Imperator

    7109 Posts

  • #3, by AndresMonday, 08. June 2020, 05:10 2 years ago
    Thanks! grin

    Newbie

    31 Posts