Postado Junho 30, 2015 9 anos alguém saberia me informar o motivo do erro "invalid data type" ? deis de já agradeço segue o script do sistema. [29/06/2015 23:16:23] [Error - TalkAction Interface] [29/06/2015 23:16:23] In a timer event called from: [29/06/2015 23:16:23] data/talkactions/scripts/cdbar.lua:onSay [29/06/2015 23:16:23] Description: [29/06/2015 23:16:23] (luaDoItemSetAttribute) Invalid data type local function ChangeBalls(cid, param, cancelequal) if isPlayer(cid) == true then local balls = getPlayerPokeballs(cid) for a = 1, #balls do local item = balls[a] if not getItemAttribute(item.uid, "ballorder") then return doPlayerSendTextMessage(cid, 27, "Do update your pokemon bar!") end --alterado v2.6 local name = getItemAttribute(item.uid, "poke") .. getItemAttribute(item.uid, "ballorder") if name == param then if cancelequal and item.uid == getPlayerSlotItem(cid, 8).uid then return true end doChangeBalls(cid, getPlayerSlotItem(cid, 8), item) return 0 end end end end function onSay(cid, words, param) if isPlayer(cid) == true then local tempo = 100 local storage, exhaust = 94360, 1 if not useKpdoDlls then return true end if words == "!code64" then return 0 end if words == "/pokeread" then if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(cid, 212124) <= 0 and isMonster(cid) and getCreatureMaster(cid) then --alterado v2.6 local pokemon = getCreatureSummons(cid)[1] local pokelife = (getCreatureHealth(pokemon) / getCreatureMaxHealth(pokemon)) doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", pokelife) end doUpdatePokemonsBar(cid) end if words == "/goaction" then if param == "null" then return 0 end if exhaustion.get(cid, 516) then doPlayerSendCancel(cid, 'você só pode puxar o pokemon após 1 segundo') return true end if #getCreatureSummons(cid) >= 2 and getPlayerStorageValue(cid, 212124) >= 1 then doPlayerSendCancel(cid, "You can't do that while is controling a mind") return true end if getPlayerStorageValue(cid, 16495) >= 1 then doPlayerSendCancel(cid, "can\'t use pokemon here.") --alterado v1.6 return true end if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then return true end if #getCreatureSummons(cid) >= 1 then if not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ballorder") then return doPlayerSendTextMessage(cid, 27, "Do update your pokemon bar!") end --alterado v2.6 addEvent(doReturnPokemon, 100, cid, getCreatureSummons(cid)[1], false, pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect) if param ~= getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke") .. getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ballorder") then addEvent(ChangeBalls, 900, cid, param, true) end else addEvent(ChangeBalls, 100, cid, param) end exhaustion.set(cid, 516, 1) return 0 end end return true end Editado Junho 30, 2015 9 anos por klipstyle (veja o histórico de edições) www.pokemiw.com 24 Horas Online - 1º 2º 3º 4º 5º 6º 7º gerações 100%
Postado Junho 30, 2015 9 anos Não sei não mas acredito que seja problema no pokelife> doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", pokelife) Estou salvando no item getPlayerSlotItem(cid, 8).uid um atributo chamado hp e que tem valor pokelife. Você pode colocar string e number nesse valor mas como vemos: local pokelife = (getCreatureHealth(pokemon) / getCreatureMaxHealth(pokemon)) pokelife é uma divisão que pode ou não retornar um número. Da mesma forma que na escola aprendemos que não podemos dividir um número por uma letra ou por 0, temos que garantir isso nos nossos códigos! coloca> print(getCreatureHealth(pokemon)) print(getCreatureMaxHealth(pokemon)) print(pokelife) logo após pokelife e coloca -- antes da função de itemAttribute, ficando assim: if words == "/pokeread" then if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(cid, 212124) <= 0 and isMonster(cid) and getCreatureMaster(cid) then --alterado v2.6 local pokemon = getCreatureSummons(cid)[1] local pokelife = (getCreatureHealth(pokemon) / getCreatureMaxHealth(pokemon)) print(getCreatureHealth(pokemon)) print(getCreatureMaxHealth(pokemon)) print(pokelife) --doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", pokelife) end doUpdatePokemonsBar(cid) end roda e vê oque acontece, dps me manda oque aparece no console OBS: isso que eu postei é só uma parte do código que você vai alterar no seu. Se você rodar só isso aí que eu postei vai dar merda Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Julho 1, 2015 9 anos Autor [30/06/2015 22:32:33] Irmaodofantasminha has logged in. [30/06/2015 22:32:54] 17641 [30/06/2015 22:32:54] 17641 [30/06/2015 22:32:54] 1 [30/06/2015 22:32:55] 17641 [30/06/2015 22:32:55] 17641 [30/06/2015 22:32:55] 1 [30/06/2015 22:38:35] Billada has logged out. [30/06/2015 22:38:38] 20166 [30/06/2015 22:38:38] 49669 [30/06/2015 22:38:38] 0.40600777144698 @UP Editado Julho 1, 2015 9 anos por klipstyle (veja o histórico de edições) www.pokemiw.com 24 Horas Online - 1º 2º 3º 4º 5º 6º 7º gerações 100%
Postado Julho 2, 2015 9 anos Autor @UP www.pokemiw.com 24 Horas Online - 1º 2º 3º 4º 5º 6º 7º gerações 100%
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.