Jump to content

Error.


gaby ♥

Recommended Posts

Posted

Buenas. Tengo un problema con este comando server side. Me tira el error:

'end' expected near ''

local papel, tinta, escritura 
  
function obj(thePlayer, cmd) 
    if(papel < 1 and tinta < 2) then 
    outputChatBox("No tienes los materiales necesarios.", thePlayer) 
    return 
    else if(escritura == true) then 
    outputChatBox("Tienes la mano cansada.", thePlayer) 
    return 
    end 
    outputChatBox("Escritura.", thePlayer) 
    escritura = true 
    setTimer ( function() 
        outputChatBox("Te recuperaste.", thePlayer) 
        escritura = false 
    end, 20000, 1 ) 
end 
addCommandHandler("escribir", obj) 

Posted
local papel, tinta, escritura 
  
function obj(thePlayer, cmd) 
    if(papel < 1 and tinta < 2) then 
    outputChatBox("No tienes los materiales necesarios.", thePlayer) 
    return 
    end 
    else if(escritura == true) then 
    outputChatBox("Tienes la mano cansada.", thePlayer) 
    return 
    end 
    outputChatBox("Escritura.", thePlayer) 
    escritura = true 
    setTimer ( function() 
        outputChatBox("Te recuperaste.", thePlayer) 
        escritura = false 
    end, 20000, 1 ) 
end 
addCommandHandler("escribir", obj) 

Posted
local papel, tinta, escritura 
  
function obj(thePlayer, cmd) 
    if(papel < 1 and tinta < 2) then 
    outputChatBox("No tienes los materiales necesarios.", thePlayer) 
    return 
    end 
    else if(escritura == true) then 
    outputChatBox("Tienes la mano cansada.", thePlayer) 
    return 
    end 
    outputChatBox("Escritura.", thePlayer) 
    escritura = true 
    setTimer ( function() 
        outputChatBox("Te recuperaste.", thePlayer) 
        escritura = false 
    end, 20000, 1 ) 
end 
addCommandHandler("escribir", obj) 

Gracias, pude arreglarlo poniendole "if" sólo, en vez de "else if" en la linea 8.

¿Alguno me puede explicar por qué no me andaba cuando ponía con else if? Así no me pasa denuevo :P.

Posted

No es correcto pekio123...

local papel, tinta, escritura 
  
function obj(thePlayer, cmd) 
    if(papel < 1 and tinta < 2) then 
        outputChatBox("No tienes los materiales necesarios.", thePlayer) 
        return 
    elseif(escritura == true) then 
        outputChatBox("Tienes la mano cansada.", thePlayer) 
        return 
    end 
    outputChatBox("Escritura.", thePlayer) 
    escritura = true 
    setTimer ( function() 
        outputChatBox("Te recuperaste.", thePlayer) 
        escritura = false 
    end, 20000, 1 ) 
end 

Posted
No es correcto pekio123...
local papel, tinta, escritura 
  
function obj(thePlayer, cmd) 
    if(papel < 1 and tinta < 2) then 
        outputChatBox("No tienes los materiales necesarios.", thePlayer) 
        return 
    elseif(escritura == true) then 
        outputChatBox("Tienes la mano cansada.", thePlayer) 
        return 
    end 
    outputChatBox("Escritura.", thePlayer) 
    escritura = true 
    setTimer ( function() 
        outputChatBox("Te recuperaste.", thePlayer) 
        escritura = false 
    end, 20000, 1 ) 
end 

Tampoco me anda así.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...