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

TFS 0.X tfs 0.4 Banuta Shortcutt not working

dunnish

New Member
Joined
Jun 18, 2009
Messages
268
Solutions
1
Reaction score
2
Hello!
i got this code but its not working for tfs 0.4

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.actionid ~= 62378 then
        return false
    end

    if player:getStorageValue(Storage.DeeperBanutaShortcut) ~= 1 then
        player:removeItem(10523, 1)
        player:setStorageValue(Storage.DeeperBanutaShortcut, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You discovered a secret tunnel.")
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have already discovered this secret.")
    end
    return true
end
 
Solution
Lua:
local Storage = {
    DeeperBanutaShortcut = 25121
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.actionid ~= 62378 then
        return false
    end
    if getPlayerStorageValue(cid, Storage.DeeperBanutaShortcut) > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have already discovered this secret.")
        return true
    end
    doPlayerRemoveItem(cid, 10523, 1)
    doPlayerSetStorageValue(cid, Storage.DeeperBanutaShortcut, 1)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You discovered a secret tunnel.")
    return true
end
Lua:
local Storage = {
    DeeperBanutaShortcut = 25121
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.actionid ~= 62378 then
        return false
    end
    if getPlayerStorageValue(cid, Storage.DeeperBanutaShortcut) > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have already discovered this secret.")
        return true
    end

    doPlayerRemoveItem(cid, 10523, 1)
    doPlayerSetStorageValue(uid, Storage.DeeperBanutaShortcut, 1)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You discovered a secret tunnel.")
    return true
end
 
Thx alot but i just saw that its was 2 scripts and thats why its dossnt work. :/

movements to ofc.
Lua:
local config = {
    [50084] = Position(32857, 32667, 9),
    [50085] = Position(32892, 32632, 11),
    [50086] = Position(32886, 32632, 11)
}

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local targetPosition = config[item.actionid]
    if not targetPosition then
        return true
    end

    if player:getStorageValue(Storage.DeeperBanutaShortcut) == 1 then
        player:teleportTo(targetPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    end
    return true
end
 
Lua:
local config = {
    [50084] = Position(32857, 32667, 9),
    [50085] = Position(32892, 32632, 11),
    [50086] = Position(32886, 32632, 11)
}

local Storage = {
    DeeperBanutaShortcut = 25121
}
function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then
        return true
    end
    local targetPosition = config[item.actionid]
    if not targetPosition then
        return true
    end
     if getPlayerStorageValue(cid, Storage.DeeperBanutaShortcut) == 1 then
         doTeleportThing(cid, targetPosition)
         doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
     end
    return true
end
 
thx alot. but
Code:
<movevent event="StepIn" fromaid="50084" toaid="50086" script="others/deeperBanutaShortcutTeleports.lua" />
its dossnt work.
 
i didnt see this error massage when i use the egg of the many on the snaked head statue
Code:
[18:39:28.394] [Error - Action Interface]
[18:39:28.394] data/actions/scripts/other/deeperBanutaShortcut.lua:onUse
[18:39:28.394] Description:
[18:39:28.409] (LuaInterface::luaDoCreatureSetStorage) Creature not found
and the egg of the many dissipear
 
Lua:
local Storage = {
    DeeperBanutaShortcut = 25121
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.actionid ~= 62378 then
        return false
    end
    if getPlayerStorageValue(cid, Storage.DeeperBanutaShortcut) > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have already discovered this secret.")
        return true
    end
    doPlayerRemoveItem(cid, 10523, 1)
    doPlayerSetStorageValue(cid, Storage.DeeperBanutaShortcut, 1)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You discovered a secret tunnel.")
    return true
end
 
Solution
i changed
Code:
<movevent event="StepIn" fromaid="50084" toaid="50086" script="others/deeperBanutaShortcutTeleports.lua" />
to
Code:
<movevent type="StepIn" fromaid="50084" toaid="50086" script="others/deeperBanutaShortcutTeleports.lua" />
 
Back
Top