gaby ♥ Posted September 2, 2012 Posted September 2, 2012 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)
Arsilex Posted September 2, 2012 Posted September 2, 2012 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)
gaby ♥ Posted September 2, 2012 Author Posted September 2, 2012 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 .
-ffs-Sniper Posted September 2, 2012 Posted September 2, 2012 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
gaby ♥ Posted September 2, 2012 Author Posted September 2, 2012 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í.
Recommended Posts