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

transf action para tfs 1.4

felp

New Member
Joined
May 30, 2023
Messages
8
Reaction score
1
Hey guys, good night, can anyone transform this script to tfs 1.4? it's an action

function onUse(cid, item, frompos, item2, topos)

item1pos = {x=570, y=531, z=7, stackpos=255} --item1pos
item2pos = {x=571, y=531, z=7, stackpos=255} --item2pos
item3pos = {x=570, y=531, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

-- War Hammer --
if item.itemid == 1945 and item1.itemid == 2391 and item2.itemid == 6550 or item1.itemid == 6550 and item2.itemid == 2391 then
if math.random(1, 100) >= 1 and math.random(1, 100) <= 75 then
doRemoveItem(item1.uid,1)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item3pos,29)
doCreateItem(7758,1, item3pos)
doPlayerSendTextMessage(cid,22,'The weapon has been successfully blessed.')
elseif item.uid == 1991 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendTextMessage(cid,22,'the gun broke.')
doRemoveItem(item1.uid,1)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item3pos,3)
end
 
Hey guys, good night, can anyone transform this script to tfs 1.4? it's an action


maybe this:



Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local item1Pos = {x = 570, y = 531, z = 7, stackpos = 255} -- item1Pos
    local item2Pos = {x = 571, y = 531, z = 7, stackpos = 255} -- item2Pos
    local item3Pos = {x = 570, y = 531, z = 7, stackpos = 255} -- item3Pos
    local item1 = getTileItemById(item1Pos, 2391).uid
    local item2 = getTileItemById(item2Pos, 6550).uid
    local item3 = getTileItemById(item3Pos, item.itemid).uid

    -- War Hammer --
    if item.itemid == 1945 and ((item1 == 2391 and item2 == 6550) or (item1 == 6550 and item2 == 2391)) then
        if math.random(1, 100) >= 1 and math.random(1, 100) <= 75 then
            doRemoveItem(item1, 1)
            doRemoveItem(item2, 1)
            doSendMagicEffect(item3Pos, CONST_ME_FIREWORK_BLUE)
            doCreateItem(7758, 1, item3Pos)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The weapon has been successfully blessed.")
        elseif item.uid == 1991 and item.itemid == 1946 then
            doTransformItem(item.uid, item.itemid - 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The gun broke.")
            doRemoveItem(item1, 1)
            doRemoveItem(item2, 1)
            doSendMagicEffect(item3Pos, CONST_ME_POFF)
        end
    end
    return true
end

Test and report errors.
 
Hey guys, good night, can anyone transform this script to tfs 1.4? it's an action
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local item1pos = Position(570, 531, 7)
    local item2pos = Position(571, 531, 7)
    local item1 = Tile(item1pos):getItemById(2391) or Tile(item1pos):getItemById(6550)
    local item2 = Tile(item2pos):getItemById(2391) or Tile(item2pos):getItemById(6550)

    if item:getId() == 1945 and item1 and item2 then
        if math.random(100) <= 75 then
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            Game.createItem(7758, 1, item1pos)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The weapon has been successfully blessed.')
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The gun broke.')
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
        end
    end
    return true
end
 
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local item1pos = Position(570, 531, 7)
    local item2pos = Position(571, 531, 7)
    local item1 = Tile(item1pos):getItemById(2391) or Tile(item1pos):getItemById(6550)
    local item2 = Tile(item2pos):getItemById(2391) or Tile(item2pos):getItemById(6550)

    if item:getId() == 1945 and item1 and item2 then
        if math.random(100) <= 75 then
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            Game.createItem(7758, 1, item1pos)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The weapon has been successfully blessed.')
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The gun broke.')
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
        end
    end
    return true
end

good night guys
I have a doubt which action I put on the lever?





Lua:
local Teste = Action()

function Teste.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local item1pos = Position(562, 486, 7)
    local item2pos = Position(563, 486, 7)
    local item1 = Tile(item1pos):getItemById(2391) or Tile(item1pos):getItemById(6550)
    local item2 = Tile(item2pos):getItemById(2391) or Tile(item2pos):getItemById(6550)

    if item:getId() == 1945 and item1 and item2 then
        if math.random(100) <= 75 then
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            Game.createItem(7758, 1, item1pos)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The weapon has been successfully blessed.')
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The gun broke.')
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
        end
    end
    return true
end

Teste:register()
 
good night guys
I have a doubt which action I put on the lever?





Lua:
local Teste = Action()

function Teste.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local item1pos = Position(562, 486, 7)
    local item2pos = Position(563, 486, 7)
    local item1 = Tile(item1pos):getItemById(2391) or Tile(item1pos):getItemById(6550)
    local item2 = Tile(item2pos):getItemById(2391) or Tile(item2pos):getItemById(6550)

    if item:getId() == 1945 and item1 and item2 then
        if math.random(100) <= 75 then
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            Game.createItem(7758, 1, item1pos)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The weapon has been successfully blessed.')
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The gun broke.')
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
        end
    end
    return true
end

Teste:register()
If u are trying revscript, in the end, before Teste:register() write Teste:aid(ACTION NUMBER) or Teste:uid(UNIQUE NUMBER) for action or unique id
 
good night guys
I have a doubt which action I put on the lever?





Lua:
local Teste = Action()

function Teste.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local item1pos = Position(562, 486, 7)
    local item2pos = Position(563, 486, 7)
    local item1 = Tile(item1pos):getItemById(2391) or Tile(item1pos):getItemById(6550)
    local item2 = Tile(item2pos):getItemById(2391) or Tile(item2pos):getItemById(6550)

    if item:getId() == 1945 and item1 and item2 then
        if math.random(100) <= 75 then
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            Game.createItem(7758, 1, item1pos)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The weapon has been successfully blessed.')
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The gun broke.')
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
        end
    end
    return true
end

Teste:register()


add on final Teste:actionid(HERE YOUR LEVER AID)

example:

Teste:actionid(2500) -- Change the action id
Teste:register()
 
add on final Teste:actionid(HERE YOUR LEVER AID)

example:

Teste:actionid(2500) -- Change the action id
Teste:register()
Teste:aid(1573)
I looked at another action script here and it has to be like this thanks guys



Good morning, thank you very much. I added another spike sword item, would you be able to shorten the script? because every time I'm going to have to add 3,4,5,6,7,8 etc... I'm going to add another 4 item to enchant I made the modification in the script it worked kk but I spent about 30m I was banging my head kk


Code:
local Teste = Action()

function Teste.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local item1pos = Position(562, 486, 7)
    local item2pos = Position(563, 486, 7)
    local item3pos = Position(562, 486, 7)
    local item4pos = Position(563, 486, 7)
    local item1 = Tile(item1pos):getItemById(2391) or Tile(item1pos):getItemById(6550)
    local item2 = Tile(item2pos):getItemById(2391) or Tile(item2pos):getItemById(6550)
    local item3 = Tile(item3pos):getItemById(2383) or Tile(item3pos):getItemById(6550)
    local item4 = Tile(item4pos):getItemById(2383) or Tile(item4pos):getItemById(6550)
       
  --- war hamer --- 
    if item:getId() == 1945 and item1 and item2 then
        if math.random(100) <= 75 then
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            Game.createItem(7758, 1, item1pos)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The weapon has been successfully blessed.')
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The gun broke.')
            item1:remove(1)
            item2:remove(1)
            item1pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
         end
    return true
end

  --- spiked sword --- 
 if item:getId() == 1945 and item3 and item4 then
        if math.random(100) <= 75 then
            item3:remove(1)
            item4:remove(1)
            item1pos:sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            Game.createItem(7744, 1, item3pos)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The weapon has been successfully blessed.')
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'The gun broke.')
            item3:remove(1)
            item4:remove(1)
            item3pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
        end
    end
end
   

Teste:aid(1573)
Teste:register()
 

Attachments

  • 1685971343860.png
    1685971343860.png
    326 bytes · Views: 2 · VirusTotal
Last edited:
Back
Top