hique86 15 Postado Setembro 9, 2011 Share Postado Setembro 9, 2011 Estou querendo colocar esse script no meu ot, mas quando fui testar, quando vou adicionar o hp, não importa a quantidade, sempre é adicionado 20000, não sei porque, isso acontece só pra adicionar o hp, para adicionar a mana está porfeitin... Script: --[[ Script by 10% Vodkart and 90% Devilmoon ]]-- --[[ para o Xtibia.com ]]-- function onSay(cid, words, param) if(words == "/addmana") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) mana = getCreatureMana(player)+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxMana(player, mana) doCreatureAddMana(player, getCreatureMaxMana(player)) doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de mana ao jogador " .. t[1] .. " ") elseif(words == "/delmana") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) mana = getCreatureMana(player)-quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxMana(player, mana) doCreatureAddMana(player, getCreatureMaxMana(player)) doPlayerSendTextMessage(player, 19, "Foram removidos "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de mana do jogador " .. t[1] .. " ") elseif(words == "/addhp") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) health = getCreatureMaxHealth(player)+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxHealth(player, health) doCreatureAddHealth(player, getCreatureMaxHealth(player)) doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de health do jogador " .. t[1] .. " ") elseif(words == "/delhp") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) health = getCreatureHealth(player)-quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxHealth(player, health) doCreatureAddHealth(player, getCreatureMaxHealth(player)) doPlayerSendTextMessage(player, 19, "Foram Removidos "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de health do jogador " .. t[1] .. " ") end return TRUE end Ss de quando adiciono o hp: Ss de quando adiciono a mana: Da uma ajuda ai quem souber, por favor e obrigado!!! Link para o comentário https://xtibia.com/forum/topic/167410-talk-adc-e-remover-manahp-by-vodkart/ Compartilhar em outros sites More sharing options...
Ilidian 4 Postado Setembro 9, 2011 Share Postado Setembro 9, 2011 Estranho funcionar certinho com mana e bugar com hp... de qualquer forma, tenta isso: --[[ Script by 10% Vodkart and 90% Devilmoon ]]-- --[[ para o Xtibia.com ]]-- function onSay(cid, words, param) if(words == "/addmana") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) mana = getCreatureMana(player)+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return true end setCreatureMaxMana(player, mana) doCreatureAddMana(player, getCreatureMaxMana(player)) doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de mana ao jogador " .. t[1] .. " ") elseif(words == "/delmana") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) mana = getCreatureMana(player)-quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return true end setCreatureMaxMana(player, mana) doCreatureAddMana(player, getCreatureMaxMana(player)) doPlayerSendTextMessage(player, 19, "Foram removidos "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de mana do jogador " .. t[1] .. " ") elseif(words == "/addhp") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) health = getCreatureMaxHealth(player)+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return true end setCreatureMaxHealth(player, getCreatureMaxHealth(player) + quanty) doCreatureAddHealth(player, getCreatureMaxHealth(player)) doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de health do jogador " .. t[1] .. " ") elseif(words == "/delhp") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) health = getCreatureHealth(player)-quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return true end setCreatureMaxHealth(player, health) doCreatureAddHealth(player, getCreatureMaxHealth(player)) doPlayerSendTextMessage(player, 19, "Foram Removidos "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de health do jogador " .. t[1] .. " ") end return true end Link para o comentário https://xtibia.com/forum/topic/167410-talk-adc-e-remover-manahp-by-vodkart/#findComment-1100281 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Setembro 10, 2011 Share Postado Setembro 10, 2011 --[[ Script by 10% Vodkart and 90% Devilmoon ]]-- --[[ para o Xtibia.com ]]-- function onSay(cid, words, param) if(words == "/addmana") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) mana = getCreatureMana(player)+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxMana(player, mana) doCreatureAddMana(player, getCreatureMaxMana(player)) doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de mana ao jogador " .. t[1] .. " ") elseif(words == "/delmana") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) mana = getCreatureMana(player)-quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxMana(player, mana) doCreatureAddMana(player, getCreatureMaxMana(player)) doPlayerSendTextMessage(player, 19, "Foram removidos "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de mana do jogador " .. t[1] .. " ") elseif(words == "/addhp") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) health = getCreatureHealth(player)+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxHealth(player, health) doCreatureAddHealth(player, getCreatureMaxHealth(player)) doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de health do jogador " .. t[1] .. " ") elseif(words == "/delhp") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) health = getCreatureHealth(player)-quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxHealth(player, health) doCreatureAddHealth(player, getCreatureMaxHealth(player)) doPlayerSendTextMessage(player, 19, "Foram Removidos "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de health do jogador " .. t[1] .. " ") end return TRUE end Link para o comentário https://xtibia.com/forum/topic/167410-talk-adc-e-remover-manahp-by-vodkart/#findComment-1100857 Compartilhar em outros sites More sharing options...
hique86 15 Postado Setembro 13, 2011 Autor Share Postado Setembro 13, 2011 Nenhuma das alternativas funcionou, continua na mesma. Qualquer quantidade que eu adiciono de hp no player, sempre é adicionado 20k de hp. Ajuda ae por favor!! Link para o comentário https://xtibia.com/forum/topic/167410-talk-adc-e-remover-manahp-by-vodkart/#findComment-1102161 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Setembro 15, 2011 Share Postado Setembro 15, 2011 Ele fez uma confusão no script, melhor refazer todo. Link para o comentário https://xtibia.com/forum/topic/167410-talk-adc-e-remover-manahp-by-vodkart/#findComment-1103188 Compartilhar em outros sites More sharing options...
hique86 15 Postado Setembro 15, 2011 Autor Share Postado Setembro 15, 2011 não manjo de script =/ alguém refaz pra mim ou monta um script com essa função, por favor!! valew Link para o comentário https://xtibia.com/forum/topic/167410-talk-adc-e-remover-manahp-by-vodkart/#findComment-1103232 Compartilhar em outros sites More sharing options...
Posts Recomendados