• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Item not decaying.

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).

When I create the item:
2yl1st2.png
Works perfectly :)

But when I make a new character whith this item on its weapon slot:
e02yk3.png
it stays even after 5min etc.

Server\data\creaturescripts\scripts\firstitems.lua
Code:
function onLogin(cid)

    if getPlayerStorageValue(cid, 6700) == -1 then
        setPlayerStorageValue(cid,6701,0)
          setPlayerStorageValue(cid,7100,1)
          setPlayerStorageValue(cid,7101,0)
          setPlayerStorageValue(cid,7102,0)
          setPlayerStorageValue(cid,7103,0)
          setPlayerStorageValue(cid,7104,0)
          setPlayerStorageValue(cid,7105,0)
          setPlayerStorageValue(cid,7106,0)
          setPlayerStorageValue(cid,7107,0)
          setPlayerStorageValue(cid,7108,0)

doAddMapMark(cid,{x=1058,y=992,z=7},5,"Temple")
doAddMapMark(cid,{x=1007,y=1013,z=7},8,"The Armory")
doAddMapMark(cid,{x=988,y=1060,z=7},8,"The Smithery")
doAddMapMark(cid,{x=1018,y=1049,z=7},6,"The Bar")
doAddMapMark(cid,{x=1059,y=1068,z=7},11,"The Magic Shop")
doAddMapMark(cid,{x=1072,y=1057,z=7},11,"The Furniture Shop")
doAddMapMark(cid,{x=1082,y=983,z=7},11,"The Tanner")
doAddMapMark(cid,{x=1073,y=969,z=7},3,"The Kings Castle")
doAddMapMark(cid,{x=1025,y=1034,z=7},1,"The Libary")
doAddMapMark(cid,{x=983,y=1035,z=7},11,"The Alchemist")
doAddMapMark(cid,{x=986,y=1006,z=7},11,"The Potion Store")
doAddMapMark(cid,{x=1002,y=991,z=7},11,"The Doll Shop")
doAddMapMark(cid,{x=983,y=972,z=7},11,"The Rusty Store")
doAddMapMark(cid,{x=1000,y=937,z=7},0,"The Royal Garden")
doAddMapMark(cid,{x=984,y=908,z=7},5,"The Cemetery")
doAddMapMark(cid,{x=1060,y=940,z=7},8,"Swords Shop")
doAddMapMark(cid,{x=1067,y=950,z=7},8,"Axe Shop")
doAddMapMark(cid,{x=1078,y=950,z=7},8,"Distance Shop")
doAddMapMark(cid,{x=1085,y=940,z=7},8,"Club Shop")
doAddMapMark(cid,{x=1006,y=1044,z=7},11,"The Jewelery Store")
doAddMapMark(cid,{x=966,y=1048,z=6},10,"The Keymaker")
doAddMapMark(cid,{x=920,y=998,z=7},11,"Creature Products")
doAddMapMark(cid,{x=914,y=969,z=7},7,"Lumberjack")
doAddMapMark(cid,{x=866,y=1012,z=7},7,"Stone Masonry")
doAddMapMark(cid,{x=837,y=941,z=7},3,"Nightmare Knights Castle")
doAddMapMark(cid,{x=1092,y=1155,z=6},3,"The Light House")
doAddMapMark(cid,{x=1102,y=1165,z=6},11,"The Fish Gutter")
doAddMapMark(cid,{x=1118,y=1151,z=6},9,"Housings Building")
doAddMapMark(cid,{x=1046,y=1045,z=7},7,"Tool Store")

        if getPlayerVocation(cid) == 1 then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Welcome to our server. Have fun and do not forget to check you questlog.")
          doPlayerAddItem(cid, 2512, 1) -- wooden shield
          doPlayerAddItem(cid, 4340, 1) -- Inisible 1 sec decay
                doPlayerAddItem(cid, 2050, 1) -- torch
                doPlayerAddItem(cid, 2461, 1) -- leather helmet
                doPlayerAddItem(cid, 2467, 1) -- leather armor
                doPlayerAddItem(cid, 2649, 1) -- leather legs
                doPlayerAddItem(cid, 2643, 1) -- leather boots
                doPlayerAddItem(cid, 2661, 1) -- scarf
            local bag = doPlayerAddItem(cid, 1988, 1)
        doAddContainerItem(bag, 2674, 1) -- apple
        doAddContainerItem(bag, 2120, 1) -- rope
          doAddContainerItem(bag, 2382, 1) -- basic club
          doAddContainerItem(bag, 2380, 1) -- basic axe
          doAddContainerItem(bag, 2182, 1) -- basic earth staff
          doAddContainerItem(bag, 2376, 1) -- basic sword
          doAddContainerItem(bag, 5907, 1) -- slingshot
        end
        setPlayerStorageValue(cid, 6700, 1)
end
    return TRUE
end

Server\data\items\items.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<items>
//
    <item id="4340" name="instant decay">
        <attribute key="decayTo" value="0"/>
        <attribute key="duration" value="1"/>
    </item>
//
</items>

Maybe any of you knows how to fix this?

Thanks in advance.
 
Console
Code:
[14/07/2015 16:09:02] Lua Script Error: [CreatureScript Interface] 
[14/07/2015 16:09:02] data/creaturescripts/scripts/firstitems.lua:onLogin

[14/07/2015 16:09:02] luaDoRemoveItem(). Item not found


Tested all these but none seem to work :s getting same console error with all.
Code:
        doRemoveItem(4340, 1)

Code:
        doRemoveItem(cid, 4340, 1)

Code:
        doRemoveItem(4340)
 
Back
Top