Postado Janeiro 19, 2015 10 anos Boa noite, criei um script de um tile que quando é pisado, regenera toda a vida e mana do player que pisou, além de soltar um efeito, porém esse efeito não aparece, embora a vida e mana sejam healados. Sabem me dizer qual o problema? function onStepIn(cid, item, position, fromPosition) local maxmana = getCreatureMaxMana(cid) local maxhealth = getCreatureMaxHealth(cid) local pos = getCreaturePosition(cid) if isPlayer(cid) then doSendMagicEffect(pos, 39) doCreatureAddHealth(cid, maxhealth) doCreatureAddMana(cid, maxmana) doPlayerSendTextMessage(cid, 22, "You have been restored.") end return true end Obrigado c:
Postado Janeiro 19, 2015 10 anos Solução tenta assim: function onStepIn(cid, item, position, fromPosition) local maxmana = getCreatureMaxMana(cid) local maxhealth = getCreatureMaxHealth(cid) if isPlayer(cid) then doSendMagicEffect(position, 39) doCreatureAddHealth(cid, maxhealth) doCreatureAddMana(cid, maxmana) doPlayerSendTextMessage(cid, 22, "You have been restored.") end return true end
Postado Janeiro 19, 2015 10 anos Tenho esse script caso lhe ajude ( Recupera Life e Mana): Vai em globalevents.xml e coloca: <globalevent name="areahealth" interval="1" script="areahealth.lua"/> Depois vá em Globalevents>script e cria um lua com o nome areahealth local centerpos = {x = 1025, y = 913, z = 7}local pos ={{{x = centerpos.x-1, y = centerpos.y-1, z = centerpos.z, stackpos = 253}},{{x = centerpos.x-1, y = centerpos.y, z = centerpos.z, stackpos = 253}},{{x = centerpos.x-1, y = centerpos.y+1, z = centerpos.z, stackpos = 253}},{{x = centerpos.x, y = centerpos.y-1, z = centerpos.z, stackpos = 253}},{{x = centerpos.x, y = centerpos.y, z = centerpos.z, stackpos = 253}},{{x = centerpos.x, y = centerpos.y+1, z = centerpos.z, stackpos = 253}},{{x = centerpos.x+1, y = centerpos.y-1, z = centerpos.z, stackpos = 253}},{{x = centerpos.x+1, y = centerpos.y, z = centerpos.z, stackpos = 253}},{{x = centerpos.x+1, y = centerpos.y+1, z = centerpos.z, stackpos = 253}},}function onThink(cid, interval, lastExecution)for _, positions in pairs(pos) dodoSendMagicEffect(positions[1], 13)if getThingFromPos(positions[1]).itemid > 0 thenfor _, name in pairs(getOnlinePlayers()) dolocal player = getPlayerByName(name)doCreatureAddHealth(player, 11)doSendAnimatedText(positions[1], "+100", 18)endendendreturn TRUEend Onde está em Vermelho é a posição do tile que irá curar. Onde está em Verde é o quanto você quer que recupere.
Postado Janeiro 19, 2015 10 anos testa agr rapaz function onStepIn(cid, item, position, fromPosition) local maxmana = getCreatureMaxMana(cid) local maxhealth = getCreatureMaxHealth(cid) if isPlayer(cid) then doSendMagicEffect(position, 39) doCreatureAddHealth(cid, maxhealth) doCreatureAddMana(cid, maxmana) doPlayerSendTextMessage(cid, 22, "You have been restored.") end return true end
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.