Progenosis
Member
- Joined
- Sep 6, 2011
- Messages
- 131
- Reaction score
- 18
Some days ago I was asking for a script that show to the player the real HP and Mana on HighExp server for high level players since, as we know, the number of health and mana points can't fit the assigned space on the interface and random numbers show instead.
So, some people helped me to get the script and I just want to share it with you since, when I looked for it, couldn't find it.
Thanks to @Eduardo170 and @Xeraphus.
Here we go:
Step #1:
- Go to: data / creaturescripts / scripts
- Copy/Paste a script and rename it to: "RealHPandMANA.lua"
- Open RealHPandMANA.lua , erase all the content and paste this code:
** Feel free to edit this line as you wish, only if you know what you're doing:
doPlayerSendTextMessage(cid,23,"Actualmente tienes: "..playerHealth.."/"..playerMaxHealth.." de HP y "..playerMana.."/"..playerMaxMana.." de mana.")
- Save the file.
Step #2:
- Go to: data / creaturescripts and open "creaturescripts.xml"
- Paste the following code:
- Save the file.
Step #3:
- Go to: data / creaturescripts / scripts
- Search for "login.lua" and open the file.
- Paste the following code:
- Save the file.
It is all ready now, run your server!
So, some people helped me to get the script and I just want to share it with you since, when I looked for it, couldn't find it.
Thanks to @Eduardo170 and @Xeraphus.
Here we go:
Step #1:
- Go to: data / creaturescripts / scripts
- Copy/Paste a script and rename it to: "RealHPandMANA.lua"
- Open RealHPandMANA.lua , erase all the content and paste this code:
Code:
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,"Actualmente tienes: "..playerHealth.."/"..playerMaxHealth.." de HP y "..playerMana.."/"..playerMaxMana.." de mana.")
end
return TRUE
end
** Feel free to edit this line as you wish, only if you know what you're doing:
doPlayerSendTextMessage(cid,23,"Actualmente tienes: "..playerHealth.."/"..playerMaxHealth.." de HP y "..playerMana.."/"..playerMaxMana.." de mana.")
- Save the file.
Step #2:
- Go to: data / creaturescripts and open "creaturescripts.xml"
- Paste the following code:
Code:
<event type="think" name="showinfo" event="script" value="RealHPandMANA.lua"/>
- Save the file.
Step #3:
- Go to: data / creaturescripts / scripts
- Search for "login.lua" and open the file.
- Paste the following code:
Code:
registerCreatureEvent(cid, "showinfo")
- Save the file.
It is all ready now, run your server!