Teste assim:
function onSay(cid, words, param, channel) local func = doCreateMonster if(words:sub(2, 2) == "n") then func = doCreateNpc end local pid = cid local t = string.explode(param, ",") local position = getCreaturePosition(pid) local effect = CONST_ME_MAGIC_RED local ret = func(t[1], position, false) if(tonumber(ret) == nil) then effect = CONST_ME_POFF doPlayerSendDefaultCancel(cid, (ret == false and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM)) end doSendMagicEffect(position, effect) return true end






info
Grupo: Artesão
Registrado: 20/04/15
Posts: 134
Reputação: +2
error - talkaction interface
data/talkactions/scripts/creature.lua:onsay
ve ai pra min oq ta errado q não consegui achar
function onSay(cid, words, param)
local func = doCreateMonster
if(words:sub(2, 2) == "n") then
func = doCreateNpc
end
local position = getCreaturePosition(cid)
local effect = CONST_ME_MAGIC_RED
if(func(param, position) == LUA_ERROR) then
effect = CONST_ME_POFF
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
end
doSendMagicEffect(position, effect)
return TRUE
end