BR

[TUTORIAL] Solução player perdendo HP/Mana toda vez que morre!

Por BrunoBrilha, 08 de ago. de 2022 em Scripts

tutorial
tutoriais
hp
mana
script
1
2.5k
BrunoBrilhaB
08 de agosto de 2022 às 15:12

Sua base toda vez que morre perde uma certa % de HP/MANA, ao chegar A 0 de HP/MANA ele não volta mais?

Aqui esta a solução!

 

 

Pasta > Servidor > Data > Creaturescriptscreaturescripts.XML

Adicione isso em uma das linha:

 <event type="think" name="hpmanareal" event="script" value="hpmanareal.lua"/>

 

 

 

Pasta > Servidor > Data > Creaturescripts > Scripts > hpmanarea.lua

Crie o arquivo hpmanarea.lua e cole isso:

function onThink(cid, interval)
 
if isPlayer(cid) then
    local playerMaxHealth = getCreatureMaxHealth(cid)
    local playerHealth = getCreatureHealth(cid)
    local playerMaxMana = getCreatureMaxMana(cid)
    local playerMana = getCreatureMana(cid)
    doPlayerSendTextMessage(cid,23,"HP: "..playerHealth.."/"..playerMaxHealth..". ||| MANA: "..playerMana.."/"..playerMaxMana..".")
end
return TRUE
end

 

 

 

Pasta > Servidor > Data > Creaturescripts > Scripts > Login.lua

Adicione isso antes do ultimo "END" do seu codigo:

registerCreatureEvent(cid, "hpmanareal")

 

 

 

Discord do meu  servidor:

https://discord.gg/34b5PeJT4P