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

Firstitems.xml repeating

ZeeBeast

Preferable Beta Tester
Joined
Dec 5, 2013
Messages
206
Reaction score
10
Location
United States
Every time I die, I lose all the items I had before death, and get the starter items again. Even if I take all items off and die, I get the starter items back. Can anyone help me?
 
I hope you using Tfs 0.3.6

Code:
function onLogin(cid)
    if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
        if isSorcerer(cid) then
            local bag = doPlayerAddItem(cid, 9774, 1)
            doAddContainerItem(bag, 5710, 1)    --Light Shovel--
            doAddContainerItem(bag, 7731, 1)    --Elvenhair Rope--
            doAddContainerItem(bag, 2160, 2)    --Crystal Coin--
            doAddContainerItem(bag, 7620, 25)    --Mana Pot--
            doAddContainerItem(bag, 2789, 10)    --Brown Mushroom--
            doAddContainerItem(bag, 7618, 5)        --Health Potion--
           
            doPlayerAddItem(cid, 2525, 1)    --Dwarven Shield--
            doPlayerAddItem(cid, 2190, 1)    --Wand Of Vortex --
            doPlayerAddItem(cid, 8871, 1)    --Focus Cape--           
            doPlayerAddItem(cid, 2323, 1)    --Hat of the Mad--
            doPlayerAddItem(cid, 7730, 1)    --Blue Legs--
            doPlayerAddItem(cid, 2643, 1)    --Leather Boots

        setPlayerStorageValue(cid, 50000, 1)

        elseif isDruid(cid) then
            local bag = doPlayerAddItem(cid, 9774, 1)
            doAddContainerItem(bag, 5710, 1)
            doAddContainerItem(bag, 7731, 1)
            doAddContainerItem(bag, 2160, 2)
            doAddContainerItem(bag, 7620, 25)
            doAddContainerItem(bag, 2789, 10)       
            doAddContainerItem(bag, 7618, 5)   
       
            doPlayerAddItem(cid, 2525, 1)
            doPlayerAddItem(cid, 2182, 1)
            doPlayerAddItem(cid, 8871, 1)
            doPlayerAddItem(cid, 2323, 1)
            doPlayerAddItem(cid, 7730, 1)
            doPlayerAddItem(cid, 2643, 1)

            setPlayerStorageValue(cid, 50000, 1)

        elseif isPaladin(cid) then
            local bag = doPlayerAddItem(cid, 9774, 1)
            doAddContainerItem(bag, 5710, 1)
            doAddContainerItem(bag, 7731, 1)
            doAddContainerItem(bag, 2160, 2)
            doAddContainerItem(bag, 7620, 10)
            doAddContainerItem(bag, 2789, 10)
            doAddContainerItem(bag, 7618, 25)
       
            doPlayerAddItem(cid, 2389, 3)
            doPlayerAddItem(cid, 2528, 1)
            doPlayerAddItem(cid, 2497, 1)
            doPlayerAddItem(cid, 2643, 1)
            doPlayerAddItem(cid, 2477, 1)
            doPlayerAddItem(cid, 2476, 1)
           
            setPlayerStorageValue(cid, 50000, 1)

        elseif isKnight(cid) then
            local bag = doPlayerAddItem(cid, 9774, 1)
            doAddContainerItem(bag, 5710, 1)
            doAddContainerItem(bag, 2160, 2)
            doAddContainerItem(bag, 7731, 1)
            doAddContainerItem(bag, 8601, 1)
            doAddContainerItem(bag, 7620, 10)
            doAddContainerItem(bag, 2789, 10)
            doAddContainerItem(bag, 7618, 25)
       
            doPlayerAddItem(cid, 2528, 1)
            doPlayerAddItem(cid, 2476, 1)
            doPlayerAddItem(cid, 2497, 1)
            doPlayerAddItem(cid, 2477, 1)
            doPlayerAddItem(cid, 2643, 1)

            setPlayerStorageValue(cid, 50000, 1)
        end
    end
    return TRUE
end
 
I use the forgotten server 0.2.14.
This is my doors.lua:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isInArray(questDoors, item.itemid) == TRUE then
        if getPlayerStorageValue(cid, item.actionid) ~= -1 then
            doTransformItem(item.uid, item.itemid + 1)
            doTeleportThing(cid, toPosition, TRUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
        end
        return TRUE
    elseif isInArray(levelDoors, item.itemid) == TRUE then
        if item.actionid > 0 and getPlayerLevel(cid) >= item.actionid - 1000 then
            doTransformItem(item.uid, item.itemid + 1)
            doTeleportThing(cid, toPosition, TRUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
        end
        return TRUE
    elseif isInArray(keys, item.itemid) == TRUE then
        if itemEx.actionid > 0 then
            if item.actionid == itemEx.actionid then
                if doors[itemEx.itemid] ~= nil then
                    doTransformItem(itemEx.uid, doors[itemEx.itemid])
                    return TRUE
                end
            end
            doPlayerSendCancel(cid, "The key does not match.")
            return TRUE
        end
        return FALSE
    elseif isInArray(horizontalOpenDoors, item.itemid) == TRUE then
        local newPosition = toPosition
        newPosition.y = newPosition.y + 1
        local doorPosition = fromPosition
        doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
        local doorCreature = getThingfromPos(doorPosition)
        if doorCreature.itemid ~= 0 then
            if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid then
                doPlayerSendCancel(cid, "Sorry, not possible.")
            else
                doTeleportThing(doorCreature.uid, newPosition, TRUE)
                if isInArray(openSpecialDoors, item.itemid) ~= TRUE then
                    doTransformItem(item.uid, item.itemid - 1)
                end
            end
            return TRUE
        end
        doTransformItem(item.uid, item.itemid - 1)
        return TRUE
    elseif isInArray(verticalOpenDoors, item.itemid) == TRUE then
        local newPosition = toPosition
        newPosition.x = newPosition.x + 1
        local doorPosition = fromPosition
        doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
        local doorCreature = getThingfromPos(doorPosition)
        if doorCreature.itemid ~= 0 then
            if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid then
                doPlayerSendCancel(cid, "Sorry, not possible.")
            else
                doTeleportThing(doorCreature.uid, newPosition, TRUE)
                if isInArray(openSpecialDoors, item.itemid) ~= TRUE then
                    doTransformItem(item.uid, item.itemid - 1)
                end
            end
            return TRUE
        end
        doTransformItem(item.uid, item.itemid - 1)
        return TRUE
    elseif doors[item.itemid] ~= nil then
        if item.actionid == 0 then
            doTransformItem(item.uid, doors[item.itemid])
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
        end
        return TRUE
    end
    return FALSE
end
 
Back
Top