• 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
 
This will say everything normally like

You see yourself. You are a druid. [Reset: 0]
And when you look at a staff member It will say

You see Noob. He is a god.

etc.?
 
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
why not freeing result?
 
Code:
[29/08/2010 14:38:55] [Error - CreatureScript Interface] 
[29/08/2010 14:38:55] data/creaturescripts/scripts/reset.lua:onLook
[29/08/2010 14:38:55] Description: 
[29/08/2010 14:38:55] data/creaturescripts/scripts/reset.lua:5: attempt to concatenate local 'Query' (a table value)
[29/08/2010 14:38:55] stack traceback:
[29/08/2010 14:38:55] 	data/creaturescripts/scripts/reset.lua:5: in function <data/creaturescripts/scripts/reset.lua:1>

I used yours Sonical, not working
 
Lua:
 local function getPlayerFrags(cid)
 
	local res = db.getResult("SELECT `resets` FROM `players` WHERE `id` = '"..getPlayerGUID(cid).."' ;")
	local value = 0
	if(res:getID() ~= -1) then
		value = res:getDataInt("resets")
		res:free()
	end
	return value
end
 function onLook(cid, thing, position, lookDistance)

	if isPlayer(thing.uid) then
		doPlayerSetSpecialDescription(thing.uid, "[Reset : "..getPlayerFrags(thing.uid).."]")	
	end
	return true
end
 
Back
Top