• 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 1.X+ transform item

theduck

Member
Joined
Dec 6, 2018
Messages
246
Reaction score
20
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
        if (item:getId() == 36309) then 
            item:transform(36310)             
        elseif (item:getId() == 36310) then
            item:transform(36311)             
        elseif (item:getId() == 36311) then
            item:transform(36312)
        elseif (item:getId() == 36312) then
            item:transform(36309)  
    end
    return true
end
[code]

Hello I am trying to make that every time the player uses the item he will become more accurate that after a while the item returns to the first
 
And why don't you edit your items.xml and avoid having to make scripts that return them to their original state?
XML:
    <item id="36309" article="a" name="First Item" />
    <item id="36310" article="a" name="Second Item" />
        <attribute key="showduration" value="0" />
        <attribute key="duration" value="3600" /> <!-- Time in seconds, 3600 means an hour (60 * 60s) = 3600s  -->
        <attribute key="decayTo" value="36309" />
    </item>
    <item id="36311" article="a" name="Third Item" />
        <attribute key="showduration" value="0" />
        <attribute key="duration" value="3600" />
        <attribute key="decayTo" value="36309" />
    </item>
    <item id="36312" article="a" name="Four Item" />
        <attribute key="showduration" value="0" />
        <attribute key="duration" value="3600" />
        <attribute key="decayTo" value="36309" />
    </item>
 
Back
Top