• 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 OnLook Script

Trader

New Member
Joined
Aug 12, 2009
Messages
219
Reaction score
2
Hello, does anyone have an OnLook script that allows you to see a players HP/Mana, IP Address etc?

I had to construct a new OnLook function so HP/Mana and IP don't show on the players anymore. Where is the default OnLook script?

Well, thanks :peace:
 
You have to be at least tutor if you want to see their "staff info".
Lua:
function getPlayerReset(cid) 
        local name = getCreatureName(cid) 
        local Query = db.getResult("SELECT `resets` FROM `players` WHERE `name` = '"..name.."';") 
        return Query:getDataInt("resets") 
end 
 
function onLook(cid, thing, position, lookDistance) 
    if(not isPlayer(thing.uid)) then 
        return true 
    end 
 	if getPlayerGroupId(cid) >= 4 then 
	doPlayerSendTextMessage(cid,22,"HP: " .. getCreatureHealth(thing.uid) .. "/".. getCreatureMaxHealth(thing.uid) .." MP: " .. getCreatureMana(thing.uid) .. "/".. getCreatureMaxMana(thing.uid) .."\n IP: ".. getPlayerIp(thing.uid) ..".")
	end
		name = getCreatureName(thing.uid)
	if getPlayerGroupId(thing.uid) == 2 and getPlayerGroupId(cid) >= 2 then
		doPlayerSendTextMessage(cid,22,"You see "..name.." his or her position is Tutor.")
		elseif getPlayerGroupId(thing.uid) == 3 and getPlayerGroupId(cid) >= 2 then
		doPlayerSendTextMessage(cid,22,"You see "..name.." his or her position is Senior Tutor.")
			elseif getPlayerGroupId(thing.uid) == 4 and getPlayerGroupId(cid) >= 2 then
		doPlayerSendTextMessage(cid,22,"You see "..name.." his or her position is Game Master.")
				elseif getPlayerGroupId(thing.uid) == 5 and getPlayerGroupId(cid) >= 2 then
		doPlayerSendTextMessage(cid,22,"You see "..name.." his or her position is Community Manager.")
						elseif getPlayerGroupId(thing.uid) == 6 and getPlayerGroupId(cid) >= 2 then
		doPlayerSendTextMessage(cid,22,"You see "..name..",his or her position is God.")
		end
		
    local name = getCreatureName(thing.uid) 
    local level = getPlayerLevel(thing.uid) 
    local sex = getPlayerSex(thing.uid) 
    local vocation = getPlayerVocationName(thing.uid) 
    local resets = getPlayerReset(thing.uid)
    local gmsg = "" 
    if sex==0 then sex="She" else sex="He" end 
    local msg = "You see "..name.." (Level "..level.."). "..sex.." is a "..vocation..". [Rebirths: "..resets.."]" 
    if getPlayerGuildId(thing.uid) > 0 then 
        local gname = getPlayerGuildName(thing.uid) 
        local grank = getPlayerGuildRank(thing.uid) 
        local gnick = getPlayerGuildNick(thing.uid) 
        gmsg = " "..sex.." is "..grank.." of the "..gname.." ("..gnick..")." 
    end 
 
    local echo = msg .. gmsg
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, echo) 
 
    return false 
end
 
Back
Top