• 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 Show health + mana Onlook

SnowFox

New Member
Joined
May 18, 2008
Messages
264
Reaction score
0
Hey guys, I need a script that when a player looks at a player it will be like.
"You see Snowfox he is a master sorcerer. He has a maximum of 1,000 health and 500 mana.

Thanks!
 
go to yourserver/data/creaturescripts/scripts/, now make a script called look.lua, there paste this:
Lua:
function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) then
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and ".\nShe" or ".\nHe") .." He has a maximum "..getCreatureMaxHealth(thing.uid).." health and "..getCreatureMaxMana(thing.uid).." mana")

end
return true
end

now go to login.lua and add this:

Lua:
 registerCreatureEvent(cid, "Look")

go to creaturescripts.xml and add this
XML:
<event type="look" name="Look" event="script" value="look.lua"/>

That's all ^^,
 
ehmm
Lua:
function onLook(cid, thing, position, lookDistance)
    if isPlayer(thing.uid) and not getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
        doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and '.\nShe' or '.\nHe') ..' has a maximum '..getCreatureMaxHealth(thing.uid)..' health and '..getCreatureMaxMana(thing.uid)..' mana')
    end
    return true
end
 
Back
Top