• 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 Setting an AID/UID from script?

Santi

Theres no way im stopping
Joined
Aug 29, 2010
Messages
1,975
Reaction score
152
Location
00
So, I want to do this:
You use pick, and a tp creates, but I want it that when the teleport creates, a UniqueID is set to that new tp
LUA:
local tile = getThingfromPos(tilepos)
local toposition = {x=EDIT, y=EDIT, z=EDIT}
local inposition = {x=EDIT, y=EDIT, z=EDIT}
function onUse(cid, item, fromPosition, ItemEx, toPosition)
         doTransformItem(itemEx.uid, 0)
         doCreateTeleport(1387, toposition, inposition)
         doItemSetAttribute(1387, "uid", 15185) 
         return true
end

If the script it's wrong, please I'd like to fix it too.
LUA:
doItemSetAtribute(1387, "uid", 15185)
I just don't know how to specify that I want THAT tp to get that UID, any help appreciated :D
 
Code:
	local tmp = doCreateTeleport(1387, toposition, inposition)
	doItemSetAttribute(tmp, 'uid', 15185)
or
Code:
	doItemSetAttribute(doCreateTeleport(1387, toposition, inposition), 'uid', 15185)
 
So, This should work?
Pick used in rock creates teleport
LUA:
local inposition = {x=EDIT, y=EDIT, z=EDIT} --- Position where tp will be created
local toposition = {x=EDIT, y=EDIT, z=EDIT} --- Position where tp will lead
function onUse(cid, item, fromPosition, itemEx, toPosition)
         doTransformItem(itemEx.uid, 0)
         local tmp = doCreateTeleport(1387, toposition, inposition)
         doItemSetAttribute(tmp, "uid", 15185)
end

Thanks!
You must spread some Reputation around before giving it to Cykotitan again. :l
 
Back
Top