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

[NPC] How to put UniqueID in a iten via Npc

hitachy

New Member
Joined
Sep 11, 2010
Messages
11
Reaction score
0
Hello guys, Sry for taking u time with another newbie question.

I want to make an Npc that gives an item to a player, But that item must have and UniqueID
How to do this?? Im using "Aries 0.4.5 XML ot serv".

if msgcontains(msg, 'potion') then
doPlayerAddItem(cid,2326,1)
What to put here so the item "2326" have an UniqueID: 10102 ??
 
Ah tnx. i didt i wrong.. But if the Uid is:10102

Then it should be like this??

local uid = doPlayerAddItem(cid,2326,1)
doItemSetAttribute(uid, "10102", xxx)

What these: xxx means? What to put there? Sry, i don´t understand about acripting =T
 
yes that was what i Did at the start when darkhos explained it..

i used:

local uid = doPlayerAddItem(cid,2326,1)
doItemSetAttribute(uid, "uid", 10102)

And when i talked to the Npc ingame, i got the item ( But without the UniqueId )
when i cheked the log it said that msg: attempt to call global "doItemSetAttribute" ( a nill value )
 
I add the " " as u said:

Like this:
local uid = doPlayerAddItem(cid,2326,1)
doItemSetAttribute(uid, "uid", "10102")

But stil give a iten without UniqueID.
And the same msg: attempt to call global "doItemSetAttribute" ( a nill value )


And i tried the script Damadger sugested:

local adds = doPlayerAddItem(cid,2326,1)
doItemSetAttribute(adds, "uniqueid", 10102)

And got the same error:
Lua Script Error : [Npc interface]
data/npc/scripts/Quest3.lua: onCreatureSay

data/npc/scripts/Quest3.lua:68: attempt to call global "doItemSetAttribute" ( a nill value )
 
Last edited:
Omg.. its a 8.1 Server...

If it doesn´t have the function can i add it on a simple way?
Or i would have to decompile it to edit, and compile it again?
 
The problem is that the server does not have that function

You can add " " to a number value, you are converting it to a string value.
"doItemSetAttribute(uid, "uid" xx)" <- works with number value.
i have tested
Code:
00:29 You see a book.
It weighs 13.00 oz.
ItemID: [2325], UniqueID: [2101].
Position: [X: 395] [Y: 435] [Z: 8].

i think that the correct function in 8.1 server is

LUA:
local uid = doPlayerAddItem(cid,2326,1) 
doSetItemUniqueId (uid, xx)
 
Last edited:
Legnak Bqm

I tried what u said

local uid = doPlayerAddItem(cid,2326,1)
SetItemUniqueId (uid, xx)

And got the same think: item without Uid and the erro..

I think my server don´t have those functions =T , i will have to serch a way to add this function to it, or change the wole thing to anew ot version and start the project again, cose most of the quest that i would add to the serv ( would use these function )


i wil serch to find if my serve version "Aries 0.4.5 XML" Tibia 8.1 Have this Function ( i think it does.. )
 
Same thing. item with no Uid

and the (nil value msg)

i will serch more.. but dunno what else to try =T
 
Last edited:

Similar threads

  • Question Question
Replies
0
Views
190
Back
Top