Na prática até pode ser a mesma coisa sim, mas na teoria é diferente.
if x ~= y then
print ("Welcome!")
else
return print ("Noob!")
end
Este código retorna um valor function.
if x ~= y then
print ("Welcome!")
else
print ("Noob!")
return true
end
Já este retorna um valor booleano. Vamos usar o seguinte exemplo:
function blablabla()
if x ~= y then
print ("Welcome!")
else
print ("Noob!")
return true
end
end
if blablabla() == true then
print("OK")
end
Ele irá printar OK. Já este código:
function blablabla()
if x ~= y then
print ("Welcome!")
else
return print ("Noob!")
end
end
if blablabla() == true then
print("OK")
end
Não irá printar OK.
Mas se fosse por exemplo uma talkaction:
function onSay(cid, words, param)
if x ~= y then
print ("Welcome!")
else
return print ("Noob!")
end
end
Ai poderia ser qualquer um dos dois. Resumindo, só importa se você vai pegar o valor retornado.




info
Grupo: Conde
Registrado: 16/06/08
Posts: 998
Reputação: +185
Gênero: Masculino
tipo queria saber se:
if x ~= y then print ("Welcome!") else print ("Noob!") return true endé igual a:
if x ~= y then print ("Welcome!") else return print ("Noob!") endse a resposta for sim, funciona com true e false?
só isso que quero saber