• 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!

Show mana and Health

Tul

New Member
Joined
Apr 19, 2011
Messages
60
Reaction score
0
Hello, I need a script when you say !hp its show your currently hp / Your full hp / And percent of currently hp!

and when you say !mp its show your currently mp / Your full mp / And percent of currently mp!

Thanks!
 
Lua:
 function onSay(cid, words, param, channel)
	local method= (words == "!mp") 
	local checked = method and "mana" or "health"
	local now,max = method and getCreatureMana(cid) or getCreatureHealth(cid), method and getCreatureMaxMana(cid) or getCreatureMaxHealth(cid)
	doPlayerSendTextMessage(cid,MESSAGE_TYPES["orange"],"Current "..checked.." = "..now.."/"..max.."\n\n        ".. checked:gsub("^%l", string.upper).." percent = " ..math.floor((now/max)*100) .."%")
	return true
end

XML:
	<talkaction words="!mp;!hp" event="script" value="clean.lua"/>
 
Last edited:
Back
Top