Olá gente, queria ajuda de vcs com 2 erros que está dando em meu projeto de poketibia, estou usando a base erondino v17 bpo open source, tfs 0.3.6.
os erros são o seguinte.
1° seria o do teleport com um summon, escrevo o comando e o summon me teleporta para uma city, só que quando uso o comando, o summon me teleporta, e ele morre, e dá erro na distro, segue o erro.
e aqui abaixo está a script Tele.lua
local poke = {'Abra', 'Kadabra', 'Alakazam', 'Drowzee', 'Hypno', 'Mrmime', 'Porygon', 'Exeggutor', 'Slowbro', 'Natu', 'Espeon', 'Xatu', 'Slowking', 'Girafarig', 'Porygon2', 'Dark Abra', 'Shiny Alakazam', 'Shiny MrMime', 'Shiny Hypno'} local etele = 9499 local cdtele = 5 function onSay(cid, words, param) if #getCreatureSummons(cid) == 0 then doPlayerSendCancel(cid, "You need a pokemon to use teleport.") return true end if not isInArray(poke, getCreatureName(getCreatureSummons(cid)[1])) then doPlayerSendCancel(cid, "Sorry, this pokemon can\'t cast teleport.") return true end if exhaustion.get(cid, etele) then tempo = (exhaustion.get(cid, etele)) / 15 min = math.floor(tempo) doPlayerSendCancel(cid, "Your pokemon is tired, you have to wait more "..min.." minutes to cast teleport again.") return true end local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } local lugar = { ["pallet"] = { pos = {x=576, y=1143, z=7},level = 1,price = 0,n="Pallet"}, ["viridian"] = { pos = {x=560, y=1038, z=7},level = 1, price = 0,n="Viridian"}, ["pewter"] = { pos = {x=571, y=668, z=6},level = 1,price = 0,n="Pewter"}, ["cerulean"] = { pos = {x=1055, y=900, z=7},level = 1,price = 0,n="Cerulean"}, ["saffron"] ={ pos = {x=1054, y=1052, z=7},level = 1,price = 0,n="Saffron"}, ["celadon"] = { pos = {x=863, y=1042, z=4},level = 1,price = 0,n="Celadon"}, ["lavender"] = { pos = {x=1204, y=1046, z=7},level = 1, price = 0,n="Lavender"}, ["vermilion"] = { pos = {x=1073, y=1240, z=7},level = 1,price = 0,n="Vermilion"}, ["fuchsia"] = { pos = {x=1123, y=1449, z=7},level = 1,price = 0,n="Fuchsia"}, ["cinnabar"] ={ pos = {x=635, y=1345, z=7},level = 1,price = 0,n="Cinnabar"}, } if (param == '') then local str = "" str = str .. "Places to go :\n\nHouse\npallet\nviridian\npewter\ncerulean\nsaffron\nceladon\nlavender\nvermilion\nfuchsia\ncinnabar" doShowTextDialog(cid, 7416, str) return TRUE end if string.lower(param) == "house" then if getHouseByPlayerGUID(getPlayerGUID(cid)) then nome = getCreatureName(getCreatureSummons(cid)[1]) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 211) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) doSendMagicEffect(getThingPos(cid), 211) doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))) pos2 = {x=getThingPos(cid).x, y=getThingPos(cid).y+1, z=getThingPos(cid).z} doSendMagicEffect(getThingPos(cid), 211) doCreatureSay(cid, ""..nome..", teleport to our home!", 1) local item = getPlayerSlotItem(cid, 8) doSummonMonster(cid, getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")) local pk = getCreatureSummons(cid)[1] registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209))) doCreatureSay(getCreatureSummons(cid)[1], "TELEPORT!", TALKTYPE_MONSTER) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), CONST_ME_TELEPORT) exhaustion.set(cid, etele, cdtele) doRemoveCondition(cid, CONDITION_OUTFIT) setPlayerStorageValue(cid, 10, 0) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You don't own a house.") end return true end local a = lugar[string.lower(param)] if not(a) then doPlayerSendTextMessage(cid, 22, "This place doesn\'t exist.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only premium members can use this skill.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your pokemon can\'t concentrate during fights.") return TRUE end nome = getCreatureName(getCreatureSummons(cid)[1]) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 211) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) doSendMagicEffect(getThingPos(cid), 211) doTeleportThing(cid, a.pos) pos2 = {x=getThingPos(cid).x, y=getThingPos(cid).y+1, z=getThingPos(cid).z} doSendMagicEffect(a.pos, 211) doCreatureSay(cid, ""..nome..", teleport to "..lugar[string.lower(param)].n.."!", 1) local item = getPlayerSlotItem(cid, 8) doSummonMonster(cid, getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")) doTeleportThing(getCreatureSummons(cid)[1], pos2, false) local pk = getCreatureSummons(cid)[1] registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209))) doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209))) doCreatureSay(getCreatureSummons(cid)[1], "TELEPORT!", TALKTYPE_MONSTER) doSendMagicEffect(pos2, CONST_ME_TELEPORT) exhaustion.set(cid, etele, cdtele) doRemoveCondition(cid, CONDITION_OUTFIT) setPlayerStorageValue(cid, 10, 0) return TRUE end
bom e o segundo erro, quando dou Look em cima do player, não aparece nada, e dá o seguinte erro na distro.
e aqui abaixo está o Look.lua
local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"},
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"}, --alterado aki \/ TUDO
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}
local shinys = {
["Shiny Abra"] = "Dark Abra",
["Shiny Onix"] = "Crystal Onix",
["Shiny Gyarados"] = "Red Gyarados",
["Shiny Charizard"] = "Elder Charizard",
["Shiny Venusaur"] = "Ancient Venusaur",
["Shiny Blastoise"] = "Ancient Blastoise",
["Shiny Farfetch'd"] = "Elite Farfetch'd",
["Shiny Hitmonlee"] = "Elite Hitmonlee",
["Shiny Himonchan"] = "Elite Hitmonchan",
["Shiny Snorlax"] = "Big Snorlax",
}
-- tabela adicionado ao configuration só procura por price = ..--
function onLook(cid, thing, position, lookDistance)
local str = {}
local iname = getItemInfo(thing.itemid)
if not isCreature(thing.uid) then
if not iname or not iname.name then return true end
if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then --alterado aki
local owner = getItemAttribute(thing.uid, "firstpoke")
local pokename = getItemAttribute(thing.uid, "poke")
if shinys[pokename] then
pokename = shinys[pokename]
end
local ballName = iname.name
if getItemAttribute(thing.uid, 'ball') then
ballName = getItemAttribute(thing.uid, 'ball').. " ball"
end
table.insert(str, "You see "..iname.article.." "..ballName..".")
if getItemAttribute(thing.uid, "unique") then
table.insert(str, " It's an unique item.")
end
table.insert(str, "\nContains "..getArticle(pokename).." "..pokename)
if getItemAttribute(thing.uid, "nick") then
table.insert(str, " ("..getItemAttribute(thing.uid, "nick")..")")
end
local boost = getItemAttribute(thing.uid, "boost") or 0
if boost > 0 then
table.insert(str, " +"..boost)
end
if prices[pokename] then
table.insert(str, ". $Price: ".. prices[pokename].."")
else
table.insert(str, ". Price: unsellable")
end
table.insert(str, ".")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
local name = iname.name
name = string.gsub(name, "fainted ", "")
name = string.gsub(name, "defeated ", "")
name = doCorrectPokemonName(name)
if shinys[name] then
name = shinys[name]
end
name = "fainted "..name:lower()
table.insert(str, "You see "..iname.article.." "..name..". ")
if isContainer(thing.uid) then
table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
end
table.insert(str, "\n")
if getItemAttribute(thing.uid, "gender") == SEX_MALE then
table.insert(str, "It is male.")
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
table.insert(str, "It is female.")
else
table.insert(str, "It is genderless.")
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
elseif isContainer(thing.uid) then --containers
if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
else
table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
end
local price = prices[doCorrectString(iname.name)]
if price then
local finalPrice = thing.type > 1 and thing.type * price or price
table.insert(str, " Price: $".. finalPrice ..".")
end
if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
table.insert(str, "\nItemID: ["..thing.itemid.."]")
local pos = getThingPos(thing.uid)
table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
else
local p = getThingPos(thing.uid)
table.insert(str, "You see ")
if thing.type > 1 then
table.insert(str, thing.type.." "..iname.plural..".")
else
table.insert(str, iname.article.." "..iname.name..".")
end
if getItemAttribute(thing.uid, "unique") then
table.insert(str, " It's an unique item.")
end
local price = prices[doCorrectString(iname.name)]
if price then
local finalPrice = thing.type > 1 and thing.type * price or price
table.insert(str, " Price: $".. finalPrice ..".")
end
table.insert(str, "\n"..iname.description)
if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
table.insert(str, "\nItemID: ["..thing.itemid.."]")
table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
end
sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
return true
end
end
if not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs
table.insert(str, "You see "..getCreatureName(thing.uid)..".")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
end
if isPlayer(thing.uid) then --player
local player = thing.uid
local vip = getPlayerPremiumDays(player) > 1 and "Premuim" or "Not Premuim"
local msg = ""..getCreatureName(player).."-Level "..getPlayerLevel(player).."-"..vip..""
doShowLookPlayer(cid, player, msg)
return false
end
if getCreatureName(thing.uid) == "Evolution" then return false end
if not isSummon(thing.uid) then --monstros
local pokename = getCreatureName(thing.uid)
if shinys[pokename] then
pokename = shinys[pokename]
end
table.insert(str, "You see a wild "..string.lower(pokename)..".\n")
table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons
local pokename = getCreatureName(thing.uid)
if shinys[pokename] then
pokename = shinys[pokename]
end
local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
if getCreatureMaster(thing.uid) == cid then
local myball = getPlayerSlotItem(cid, 8).uid
table.insert(str, "You see your "..string.lower(pokename)..".")
if boostlevel > 0 then
table.insert(str, "\nBoost level: +"..boostlevel..".")
end
table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(pokename)..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
end
return false
end
return true
end
Por favor, me ajudem, dou rep +, agradeço desde já.