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

Explain what this does?

tosse12

Panchira Project Member
Joined
Jun 10, 2007
Messages
864
Reaction score
9
Location
Sweden
I got an script from Cykotitan, but I didn't really understand one part of it, and would like to know what it does :D

Code:
doTransformItem(item.uid, tonumber("194".. (item.itemid == 1945 and 6 or 5)))

All that I already know is that this do transform item to another but never seen the part
Code:
("194".. (item.itemid == 1945 and 6 or 5))
before, could someone please explain it for me? :D

(This is the whole code if you need to know)
Code:
local config = {
	id = 2111,
	pos = {x = 100, y = 100, z = 7}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
return
	true,
	item.itemid == 388 and
		doRemoveItem(getTileItemById(config.pos, config.id).uid)
	or item.itemid == 389 and
		doCreateItem(config.id, 1, config.pos),
	doTransformItem(item.uid, tonumber("194".. (item.itemid == 1945 and 6 or 5)))
end
 
("194".. (item.itemid == 1945 and 6 or 5))

Result is:
1946 if ItemID is 1945 and 1945 if ItemID is 1946 xP
 
so if I want it to be another item, I just need to change 194 and 1945 and 6 and 5 to:
194 = 38
1945 = 338
6 = 9
5 = 8
?
to work with that script? or else it transform to the wrong item id?
 
Back
Top Bottom