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

items change

ConAn Edujawa

Member
Joined
Feb 23, 2015
Messages
457
Reaction score
17
i need script
when click on weapon change from club to axe and when use again change from axe to sword and than from sword to club but don't change weapon id im.
use tfs 0.4
 
i did it but with new idea u can use items have same look type not same id
example

if u use items 10311 there 4 items same look type like 10311 ..10312..10314..10315
u can mak this...

go to ur item.xml and do this \/
Code:
        <item id="10311" article="a" name="Demon weapon sword">
        <attribute key="weight" value="5000" />
        <attribute key="defense" value="1" />
        <attribute key="attack" value="1" />
        <attribute key="extradef" value="+1" />
        <attribute key="skillSWORD" value="1" />
        <attribute key="skillAXE" value="2" />
        <attribute key="skillCLUB" value="3" />
        <attribute key="weaponType" value="sword" />
        <attribute key="description" value="SWORD." />
    </item>
        <item id="10312" article="a" name="Demon weapon club">
        <attribute key="weight" value="5000" />
        <attribute key="defense" value="1" />
        <attribute key="attack" value="1" />
        <attribute key="extradef" value="+1" />
        <attribute key="skillSWORD" value="1" />
        <attribute key="skillAXE" value="2" />
        <attribute key="skillCLUB" value="3" />
        <attribute key="weaponType" value="club" />
        <attribute key="description" value="CLUB." />
    </item>
        <item id="10314" article="a" name="Demon weapon axe">
        <attribute key="weight" value="5000" />
        <attribute key="defense" value="1" />
        <attribute key="attack" value="1" />
        <attribute key="extradef" value="+1" />
        <attribute key="skillSWORD" value="1" />
        <attribute key="skillAXE" value="2" />
        <attribute key="skillCLUB" value="3" />
        <attribute key="weaponType" value="axe" />
        <attribute key="description" value="AXE." />
    </item>
and then go to ur action/scripts and make new lua call weaponchnage.lua
Code:
local disteffect = 35

[COLOR=rgb(0, 0, 0)]local effect = 66
local ITEM_IDS = {
    [10311] = 10312,
    [10312] = 10314,
    [10314] = 10311,
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(not ITEM_IDS[item.itemid]) then
        return false
    end  
    if (exhaustion.check(cid, 17024)) then
        doPlayerSendCancel(cid, "You will be able to use this GEM again in  "..tostring(exhaustion.get(cid, 17024)).." seconds.")
        return true
    end
    local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, disteffect)
end
    doPlayerSendTextMessage(cid, 22, "You changed "..getItemInfo(item.itemid).name.." to "..getItemInfo(ITEM_IDS[item.itemid]).name..".")
    exhaustion.set(cid, 17024, 5)
    doTransformItem(item.uid, ITEM_IDS[item.itemid])
    doDecayItem(item.uid)
    doSendMagicEffect(getCreaturePosition(cid), 29)
    return true
end
now action.xml
Code:
    <action itemid="10311" event="script" value="weaponchange.lua"/>
    <action itemid="10314" event="script" value="weaponchange.lua"/>
    <action itemid="10312" event="script" value="weaponchange.lua"/>
now u have 3 weapon same looktype i hope that u search for :D
[/COLOR]
 
You can't use the same itemid for different sprites it just doesn't work like that.
I don't even think you know what you want other than to waste people's time.
 
Back
Top