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

Solved Need help with UID

nevix

Tunzodus.net
Joined
Mar 31, 2010
Messages
356
Reaction score
62
Location
Lithuanian
Here my lua script

Code:
local t = {
sec = 5,
sec2 = 5,
portal = {x = 32346, y = 32224, z = 7},
portalwhere = {x = 32347, y = 32219, z = 7},
itemid = 11796,
active = 2
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Working.")
doCreateItem(t.itemid,1,t.portal)
end


How create item with Unique ID?
 
Which server do you use?
I assume you want to let the script add an uniqueid to the item with id 11796 when it creates it?
 
It looks like this script should be some type of "teleporter"? To depot or another place, ill link u my script instead and tell you how to do!

Add in actions.xml

Code:
    <action itemid="9941" event="script"NAME OF SCRIPT.LUA"/>



Code:
function onUse(cid, item, frompos, item2, topos)
pos = {x=1169, y=1171, z=7}
if item.itemid == 9942 then

doPlayerSendCancel(cid,"You were teleported to tempel")
doTeleportThing(cid,pos)
doRemoveItem(item.uid,1)
else

doPlayerSendCancel(cid,"You cant use it in battle!")


end

return 1

end


If you dont want the item/tp crystal or what ever you name it to dissapear delete the :

doRemoveItem(item.uid,1)

line..
thx bro, but not this i searching. Limos i need help
 
You can use actionid, adding uniqueid is for TFS 0.3/0.4.
Code:
doSetItemActionId(uid, actionid)

Example
Code:
local portal = doCreateItem(t.itemid,1,t.portal)
doSetItemActionId(portal, 4034)
 
My script working perfectly :)
SO intresting to create anything :D

Code:
local t = {
sec = 5,
sec2 = 5,
portal = {x = 32346, y = 32224, z = 7},
portalwhere = {x = 32347, y = 32219, z = 7},
itemid = 11796,
active = 2
}

function onUse(cid, item, fromPosition, itemEx, toPosition)


doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Done.")
local portal = doCreateItem(t.itemid,1,t.portalwhere)
doSetItemActionId(portal, 20001)

addEvent(function()
doRemoveItem(getTileItemById(t.portalwhere, t.itemid).uid)
end,
t.sec * 1000)


return true
end
 
Back
Top