function onUse(cid, item, frompos, item2, topos) local dolls = { [11256] = {pet = "Crystal Spider"}, [11207] = {pet = "Ashmunrah"}, [11144] = {pet = "Demon"}, [9019] = {pet = "Vampire"}, } local go = dolls[item.itemid] local summon = getCreatureSummons(cid) local store,exausted = 156249,30 --------------------------------------------------- if getPlayerStorageValue(cid, store) >= os.time() then return doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.") end if #summon > 0 then for _, pid in ipairs(summon) do doRemoveCreature(pid) doCreatureSay(cid, "Can go rest ["..go.pet.."]", TALKTYPE_ORANGE_1) end else doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid))) doCreatureSay(cid, "Let battle ["..go.pet.."]", TALKTYPE_ORANGE_1) end return trueend


info
Grupo: Campones
Registrado: 15/04/15
Posts: 1
Reputação: 0
Gênero: Masculino
Estou com esse erro neste scrit, poderiam me ajudar?
Script
function onUse(cid, item, frompos, item2, topos)
local dolls = {
[11256] = {pet = "Crystal Spider"},
[11207] = {pet = "Ashmunrah"},
[11144] = {pet = "Demon"},
[9019] = {pet = "Vampire"},
}
local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
local store,exausted = 156249,30
---------------------------------------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, store) >= os.time() then
return doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.")
end
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, "Can go rest ["..go.pet.."]", TALKTYPE_ORANGE_1)
return true
end
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, "Let battle ["..go.pet.."]", TALKTYPE_ORANGE_1)
return true
end
Erro
[16/8/2016 18:10:27] [Error - LuaInterface::loadFile] data/actions/scripts/teste.lua:30: 'end' expected (to close 'function' at line 15) near '<eof>'
[16/8/2016 18:10:27] [Error - Event::checkScript] Cannot load script (data/actions/scripts/teste.lua)
[16/8/2016 18:10:27] data/actions/scripts/teste.lua:30: 'end' expected (to close 'function' at line 15) near '<eof>'