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

[8.54][TFS 0.3.6pl1] onLook.

margoh

{{ user.title }}
Joined
Apr 1, 2013
Messages
807
Solutions
18
Reaction score
355
Hello,

Today i tried to make some script.
How it should works? If we take action look on some player it should show:
You see Test. He is a sorcerer.
But if we have item X in backpack or on some slot: ammo/hand, it should shows:

You see Test. He is a sorcerer. and under this:
Level: 100 - Magic Level: 50 <<< Full customizable for item level. Better item is, more stats it shows.

But I don't know how to declare item in this script.

Can someone help me because I don't know how to do it?

Best regards,
margoh.
 
Last edited:
I was happy too soon.

- - - Updated - - -

Here is my code.
LUA:
function onLook(cid)
local level = getPlayerLevel(cid)
	  mlvl = getPlayerMagLevel(cid)

if getPlayerItemById(cid, deepSearch, 2123) then
	if(isPlayer(cid) or isCreature(cid)) then
	doPlayerSendTextMessage(cid,27,"Scanning: Level: "..level.." - Magic Level: "..mlvl.."")
	return true
end
end
end

But when i Look on ITEM or TILE/WALLS etc.
It shows this message:
Code:
10:52 Scanning: Level: 50 - Magic Level: 0

How to configure it to shows ONLY this when i just look on other player/npc/monster and not to show my own stats, only stats of person that i have just looked at.

Please help me.
 
Last edited:
You have to add condition, that if target is not player script have to do nothing. Problem in your script is that you are using "cid" as reference to other player. Remember - cid is always your character.

Regards
 
Back
Top