• 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 can't get this converted revscript to work in tfs 1.5

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
1,990
Solutions
9
Reaction score
334
Location
Chile
this is the original script used to work in tfs 1.3
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if toPosition.x == 65535 or toPosition.x == 0 then
        return true
    end
 
    local used = function(splash)
        doChangeTypeItem(item.uid, item.type - 1)
        if splash then
            doDecayItem(doCreateItem(2025, 7, toPosition))
        end
        return true, fromPosition.x == 65535 and doPlayerAddItem(cid, 6000, 1) or doCreateItem(6000, 1, fromPosition)
    end
 
    if getTopCreature(toPosition).uid ~= cid then
        return used(true)
    end
       
    doPlayerAddMana(cid, 300)
    doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
    doPlayerSay(cid, "Aaaah...", TALKTYPE_SAY)
    return used(false)
end
this is the revscript
Lua:
local manafluid_stackable = Action()

function manafluid_stackable.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if toPosition.x == 65535 or toPosition.x == 0 then
        return true
    end
 
    local used = function(splash)
        doChangeTypeItem(item.aid, item.type - 1)
        if splash then
            doDecayItem(doCreateItem(2025, 7, toPosition))
        end
        return true, fromPosition.x == 65535 and doPlayerAddItem(cid, 6000, 1) or doCreateItem(6000, 1, fromPosition)
    end
 
    if getTopCreature(toPosition).aid ~= cid then
        return used(true)
    end
       
    doPlayerAddMana(cid, 300)
    doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
    doPlayerSay(cid, "Aaaah...", TALKTYPE_SAY)
    return used(false)
end
--manafluid_stackable:type("onuse")
manafluid_stackable:aid(8777)
manafluid_stackable:register()


Now is useable
Lua:
manafluid_stackable:id(5603)
this was missing, but there are still problems, the mana is infiite (not decaying) and can be used anywhere on the map does not matter where and doe snot created the fluid
 
Last edited:
Back
Top