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

Trader

New Member
Joined
Aug 12, 2009
Messages
219
Reaction score
2
Hello OTLand,

Do you know how you double click on a player and it says:

00:59 You see Noob (Level 8). She is a druid.

Like that. Where can I find the script or whatever, I would like to customize this script, but I could never find this script, lol

Thanks
 
If you want to change it you have to do it in sources, if you want to add something you can do it in lua with doPlayerSetSpecialDescription(cid, desc)
 
Wait, where exactly is the source located so I can edit what it says when you double click on someone, I just need to add 1 thing
 
Where is the source?
And when I make my own OnLook in creatureevent, it makes new OnLook and takes away the old one
 
i donno where is this reset stored but here is an example
Code:
 function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) then
		doPlayerSetSpecialDescription(thing.uid, "[Reset : "..getreset.."]")	
	end
	return true
end

and you replace the "getreset" with the thing that resets are stored aat
 
Code:
[29/08/2010 13:54:30] [Error - CreatureScript Interface] 
[29/08/2010 13:54:30] data/creaturescripts/scripts/reset.lua:onLook
[29/08/2010 13:54:30] Description: 
[29/08/2010 13:54:30] data/creaturescripts/scripts/reset.lua:9: attempt to concatenate global 'resets' (a nil value)
[29/08/2010 13:54:30] stack traceback:
[29/08/2010 13:54:30] 	data/creaturescripts/scripts/reset.lua:9: in function <data/creaturescripts/scripts/reset.lua:7>
 
Code:
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 
	doPlayerSetSpecialDescription(cid,"HP: " .. getCreatureHealth(thing.uid) .. "/".. getCreatureMaxHealth(thing.uid) .." MP: " .. getCreatureMana(thing.uid) .. "/".. getCreatureMaxMana(thing.uid) .."\n IP: ".. doConvertIntegerToIp(getPlayerIp(thing.uid)) ..".")
	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
 
Lua:
 function onLook(cid, thing, position, lookDistance)
 local name = getCreatureName(thing.uid) 
 local Query = db.getResult("SELECT `resets` FROM `players` WHERE `name` = '"..name.."';") 
	if isPlayer(thing.uid) then
		doPlayerSetSpecialDescription(thing.uid, "[Reset : "..Query.."]")	
	end
	return true
end
 
Back
Top