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

OnLook

Qbee

Open Tibia Fan
Joined
Mar 9, 2009
Messages
174
Reaction score
4
I have
<event type="look" name="ExtraLoot" event="script" value="aa.lua"/>
in creaturescripts.xml

and
Lua:
function onLook(cid, thing, position, lookDistance)
	if thing.itemid == 2111 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wykupiles(ow.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wykuw.")
	end
end
in scripts/aa.lua

And it just doesn't work. No bugs in console. No results at all.
 
you forgot to put 'return true'
Code:
function onLook(cid, thing, position, lookDistance)
    if thing.itemid == 2111 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wykupiles(ow.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wykuw.")
    end
return true		
end
 
don't really understand why it did not work, but I'll try again.
Edit:
I tested it in my server and it worked!
here SS:
testlook.png
 
Last edited:
did you register it in login.lua?? if not open it and go to the bottom and place this:
Code:
registerCreatureEvent(cid, "ExtraLoot")
place it with the other ones that are in there.
 
Back
Top Bottom