• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Look sees MONSTER'S health

Joined
Apr 11, 2015
Messages
98
Reaction score
5
Good evening everyone.

I really want a script where when a player looks at a monster, it will show its current life and total, something like this:

You see a Dragon. Health [850/1000]

I already have a script that shows other player's health, and it goes like this, you can use this as a basis(?)(not my native language) if it will help you.

Lua:
function onLook(cid, thing, position, lookDistance)
    if thing.uid ~= cid and isPlayer(thing.uid) then
        string = '\nPlayer information ('..getCreatureName(thing.uid)..')\nHealth: ['..getCreatureHealth(thing.uid)..'/'..getCreatureMaxHealth(thing.uid)..']\nMana: ['..getCreatureMana(thing.uid)..'/'..getCreatureMaxMana(thing.uid)..']'
        doPlayerSendTextMessage(cid, 22, string)
    elseif thing.uid == cid then
        string = '\nYour information ('..getCreatureName(cid)..')\nHealth: ['..getCreatureHealth(cid)..'/'..getCreatureMaxHealth(cid)..']\nMana: ['..getCreatureMana(cid)..'/'..getCreatureMaxMana(cid)..']'
        doPlayerSendTextMessage(cid, 22, string)
    end
    return true
end

Thank you very much.
 
Solution
Good evening everyone.

I really want a script where when a player looks at a monster, it will show its current life and total, something like this:

You see a Dragon. Health [850/1000]

I already have a script that shows other player's health, and it goes like this, you can use this as a basis(?)(not my native language) if it will help you.

Lua:
function onLook(cid, thing, position, lookDistance)
    if thing.uid ~= cid and isPlayer(thing.uid) then
        string = '\nPlayer information ('..getCreatureName(thing.uid)..')\nHealth: ['..getCreatureHealth(thing.uid)..'/'..getCreatureMaxHealth(thing.uid)..']\nMana: ['..getCreatureMana(thing.uid)..'/'..getCreatureMaxMana(thing.uid)..']'
        doPlayerSendTextMessage(cid, 22, string)...
Good evening everyone.

I really want a script where when a player looks at a monster, it will show its current life and total, something like this:

You see a Dragon. Health [850/1000]

I already have a script that shows other player's health, and it goes like this, you can use this as a basis(?)(not my native language) if it will help you.

Lua:
function onLook(cid, thing, position, lookDistance)
    if thing.uid ~= cid and isPlayer(thing.uid) then
        string = '\nPlayer information ('..getCreatureName(thing.uid)..')\nHealth: ['..getCreatureHealth(thing.uid)..'/'..getCreatureMaxHealth(thing.uid)..']\nMana: ['..getCreatureMana(thing.uid)..'/'..getCreatureMaxMana(thing.uid)..']'
        doPlayerSendTextMessage(cid, 22, string)
    elseif thing.uid == cid then
        string = '\nYour information ('..getCreatureName(cid)..')\nHealth: ['..getCreatureHealth(cid)..'/'..getCreatureMaxHealth(cid)..']\nMana: ['..getCreatureMana(cid)..'/'..getCreatureMaxMana(cid)..']'
        doPlayerSendTextMessage(cid, 22, string)
    end
    return true
end

Thank you very much.
Lua:
function onLook(cid, thing, position, lookDistance)
    if thing.uid ~= cid and isPlayer(thing.uid) then
        string = '\nPlayer information ('..getCreatureName(thing.uid)..')\nHealth: ['..getCreatureHealth(thing.uid)..'/'..getCreatureMaxHealth(thing.uid)..']\nMana: ['..getCreatureMana(thing.uid)..'/'..getCreatureMaxMana(thing.uid)..']'
        doPlayerSendTextMessage(cid, 22, string)
    elseif thing.uid == cid then
        string = '\nYour information ('..getCreatureName(cid)..')\nHealth: ['..getCreatureHealth(cid)..'/'..getCreatureMaxHealth(cid)..']\nMana: ['..getCreatureMana(cid)..'/'..getCreatureMaxMana(cid)..']'
        doPlayerSendTextMessage(cid, 22, string)
    elseif isMonster(thing.uid) then
        string = '\nMonster information ('..getCreatureName(thing.uid)..')\nHealth: ['..getCreatureHealth(thing.uid)..'/'..getCreatureMaxHealth(thing.uid)..']'
        doPlayerSendTextMessage(cid, 22, string)
    end
    return true
end
 
Solution
Back
Top