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

Saper1995

Technologic
Joined
Jul 11, 2009
Messages
104
Reaction score
3
Location
Poland
Hi. Like in title. How to get uniqueID from target in TFS 1.2?

In functions i only found item:getUniqueId() but how to define ItemEx.Uid like in old tfs?
I was trying to make it in many ways but everytime nothing happend, no errors in console.
I set UID in map editor and make this:
Code:
 <action uniqueid="10699" script="special/chargelich.lua" />
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

local skull = item:getId()
local lavafountain = target:getUniqueId()

    if (skull == 2320 and lavafountain == 10699) then
    doSendMagicEffect(toPosition, 40)
     doPlayerSendTextMessage(player,MESSAGE_EVENT_ADVANCE,"All the grief of this world has been condensed in the skull.")
    doRemoveItem(item.uid, 1)
    doPlayerAddItem(player,12596,1) -- new skull
    else
            doPlayerSendCancel(player, 'Sorry, not possible.')
            doSendMagicEffect(toPosition, CONST_ME_POFF)
end
return true
end
 
Hi. Like in title. How to get uniqueID from target in TFS 1.2?

In functions i only found item:getUniqueId() but how to define ItemEx.Uid like in old tfs?
I was trying to make it in many ways but everytime nothing happend, no errors in console.
I set UID in map editor and make this:
Code:
 <action uniqueid="10699" script="special/chargelich.lua" />
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

local skull = item:getId()
local lavafountain = target:getUniqueId()

    if (skull == 2320 and lavafountain == 10699) then
    doSendMagicEffect(toPosition, 40)
     doPlayerSendTextMessage(player,MESSAGE_EVENT_ADVANCE,"All the grief of this world has been condensed in the skull.")
    doRemoveItem(item.uid, 1)
    doPlayerAddItem(player,12596,1) -- new skull
    else
            doPlayerSendCancel(player, 'Sorry, not possible.')
            doSendMagicEffect(toPosition, CONST_ME_POFF)
end
return true
end
use an action id and item:getActionId()
i also recommend switching your 0.4 functions to 1.2 methods

toPosition:sendMagicEffect
player:sendTextMessage
item:remove
player:addItem
player:sendCancelMessage

function documentation: http://pastebin.com/S3Get6Vs
 
Back
Top