Hi, im having some troubles im 2 hours trying to solve this but cant!!
I have some objects, and background, this is loggin page (main.lua), this should be: if password empty error (works) if password match with (user:profesor, pw:coromines) goes to composer(primera.lua) this doesnt works and if password doesnt match and its not empty shows user/pw incorrect this works too.
local background = display.newImageRect( "fondo6.png", 600, 350 ) background.x = display.contentCenterX background.y = display.contentCenterY display.setStatusBar( display.HiddenStatusBar ) local widget = require "widget" local composer = require "composer" local toast = require('plugin.toast') local scene = composer.newScene() local function iniciarboto( self, event ) if ( usuarisessio.text == "" or contrasenyasessio.text == "" ) then local alert = native.showAlert( "Els camps estan buits!", "Has d'omplir tots els camps.", { "D'acord" } ) return true elseif ( usuarisessio.text == "profesor" or contrasenyasessio.text == "coromines" ) then title:removeSelf() usuari:removeSelf() pw:removeSelf() iniciar:removeSelf() usuarisessio:removeSelf() contrasenyasessio:removeSelf() -- title = nil usuari = nil pw= nil iniciar= nil usuarisessio= nil contrasenyasessio= nil composer.gotoScene( "primera" ) return false else local alert = native.showAlert( "¡Usuari o contrasenya incorrecta!", "Torna a intentar.", { "D'acord" } ) return true end end ---- Objects ---- local title = display.newText( "Iniciar sessió", display.contentCenterX, 16, "Lifecraft.ttf", 32 ) title:setFillColor( 1, 0.88, 0.3 ) local usuari = display.newText( "Usuari", 200, 230, "Lifecraft.ttf", 24 ) usuari.x = 105 usuari.y = 90 local pw = display.newText( "Contrasenya", 200, 230, "Lifecraft.ttf", 24 ) pw.x = 130 pw.y = 160 local iniciar = display.newImageRect( "iniciaricono.png", 200, 40 ) iniciar.x = display.contentCenterX iniciar.y = 230 iniciar.tap = iniciarboto iniciar:addEventListener( "tap" ) local usuarisessio = native.newTextField( 320, 94, 180, 30 ) usuarisessio.placeholder = "Escriu l'usuari" local contrasenyasessio = native.newTextField( 320, 159, 180, 30 ) contrasenyasessio.placeholder = "Escriu la contrasenya" contrasenyasessio.isSecure = true
With this i get this error:

PD: If you see any other error please comment for solve it.
PD2: return true and false are well used? I mean are not the other way around?
Thanks!