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

Blueberry bush not working also lag

Chami

New Member
Joined
Jan 7, 2018
Messages
2
Reaction score
0
Hello, im working on a server that has blueberrybushes (TFS 0.2 I think).
When I tried to eat blueberries, there was no "Yum" also it appeared to not be making me full-after 100 blueberries. Why?
Also, server lags with only me online, and almost no monsters.
Grateful for help.
 
Mate, if something as trivial as a blueberry bush script is not working on your distro by default, I recommend you move away from that distro asap (assuming we're talking about the default blueberry scripts that come with it).
With that said, post the script so it can be inspected.
 
blueberry bush.lua (I changed Count to 100):

LUA:
local ITEM_BLUEBERRY_EMPTY     =    2786
local ITEM_BLUEBERRY           =    2677
local ITEM_BLUEBERRY_COUNT       =    100

function onUse(cid, item, frompos, item2, topos)
    doTransformItem(item.uid, ITEM_BLUEBERRY_EMPTY)
    doCreateItem(ITEM_BLUEBERRY, ITEM_BLUEBERRY_COUNT, frompos)
    doDecayItem(item.uid)
    return true
end

actions.lib:
LUA:
FOODS = {
    [2328] = {84, "Gulp."},    [2362] = {48, "Yum."}, [2666] = {180, "Munch."}, [2667] = {144, "Munch."},
    [2668] = {120, "Mmmm."}, [2669] = {204, "Munch."}, [2670] = {48, "Gulp."}, [2671] = {360, "Chomp."},
    [2672] = {720, "Chomp."}, [2673] = {60, "Yum."}, [2674] = {72, "Yum."}, [2675] = {156, "Yum."},
    [2676] = {96, "Yum."}, [2677] = {12, "Yum."}, [2678] = {216, "Slurp."}, [2679] = {12, "Yum."},
    [2680] = {24, "Yum."}, [2681] = {108, "Yum."}, [2682] = {240, "Yum."}, [2683] = {204, "Munch."},
    [2684] = {60, "Crunch."}, [2685] = {72, "Munch."}, [2686] = {108, "Crunch."}, [2687] = {24, "Crunch."},
    [2688] = {24, "Mmmm."}, [2689] = {120, "Crunch."}, [2690] = {72, "Crunch."}, [2691] = {96, "Crunch."},
    [2695] = {72, "Gulp."}, [2696] = {108, "Smack."}, [2769] = {60, "Crunch."}, [2787] = {108, "Crunch."},
    [2788] = {48, "Crunch."}, [2789] = {264, "Munch."}, [2790] = {360, "Crunch."}, [2791] = {108, "Crunch."},
    [2792] = {72, "Crunch."}, [2793] = {144, "Crunch."}, [2794] = {36, "Crunch."}, [2795] = {432, "Crunch."},
    [2796] = {300, "Crunch."},     [5097] = {48, "Yum."}, [5678] = {96, "Gulp."}, [6125] = {96, "Mmmm."},
    [6278] = {120, "Mmmm."}, [6279] = {180, "Mmmm."}, [6393] = {144, "Mmmm."}, [6394] = {180, "Mmmm."},
    [6501] = {240, "Mmmm."}, [6541] = {72, "Gulp."}, [6542] = {72, "Gulp."}, [6543] = {72, "Gulp."},
    [6544] = {72, "Gulp."}, [6545] = {72, "Gulp."}, [6569] = {12, "Mmmm."}, [6574] = {60, "Mmmm."},
    [7158] = {300, "Munch."}, [7159] = {180, "Munch."}, [7372] = {0, "Yummy."}, [7373] = {0, "Yummy."},
    [7374] = {0, "Yummy."},    [7375] = {0, "Yummy."}, [7376] = {0, "Yummy."}, [7377] = {0, "Yummy."},
    [7963] = {720, "Munch."},  [8838] = {120, "Gulp."}, [8839] = {60, "Yum."}, [8840] = {12, "Yum."},
    [8841] = {12, "Urgh."}, [8842] = {84, "Munch."}, [8843] = {60, "Crunch."}, [8844] = {12, "Gulp."},
    [8845] = {60, "Munch."}, [8847] = {132, "Yum."}, [9005] = {88, "Slurp."}, [9996] = {0, "Slurp."},
    [10454] = {0, "Your head begins to feel better."}, [11136] = {120, "Mmmm."}, [11246] = {180, "Yum."},
    [11370] = {36, "Urgh."}
}

food.lua (action/scripts/foods)
LUA:
local MAX_FOOD = 1200

function onUse(cid, item, frompos, item2, topos)
    if (item.itemid == 6280) then
        doPlayerSay(cid, "Blewing out the candle.", TALKTYPE_ORANGE_1)
        doTransformItem(item.uid, item.itemid - 1)
        doSendMagicEffect(frompos, CONST_ME_POFF)
        return true
    end

    if FOODS[item.itemid] == nil then
        return false
    end

    local size = FOODS[item.itemid][1]
    local sound = FOODS[item.itemid][2]

    if (getPlayerFood(cid) + size > MAX_FOOD) then
        doPlayerSendCancel(cid, "You are full.")
        return true
    end
    doPlayerFeed(cid, size)
    doRemoveItem(item.uid, 1)
    doPlayerSay(cid, sound, TALKTYPE_ORANGE_1)
    return true


end

THNX.
 
LUA:
local MAX_FOOD = 1200
LUA:
[2677] = {12, "Yum."}
LUA:
local ITEM_BLUEBERRY = 2677
Code:
20 minutes * 60 = 1200 seconds -- max_food
12 seconds per blueberry * 100 = 1200 -- max_food
5 clicks to eat blueberries = 1 second
1 second * (100 blueberries/5 clicks) = 20 seconds
1200 seconds - 20 seconds = 1180 seconds ===== Why isn't my character full?
Answer: Because your not full yet.
-- You can eat approx 103 blueberries before being full.
Also.. try this
LUA:
doCreatureSay(cid, "Blewing out the candle.", TALKTYPE_ORANGE_1, cid)
doCreatureSay(cid, sound, TALKTYPE_ORANGE_1, cid)
 
Back
Top