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

Solved {0.3.6} The Forgotten Server; Can't use scythe on wheat when player is on top of tile

xYzPrototype

Just a standard member
Joined
Feb 27, 2015
Messages
49
Reaction score
4
Location
EUW
Hi again, I have this problem where players cannot use scythe or any other tools on tiles below players.
I think this is the default option, but does anyone know how to change it so I can use scythe on tile below player?

Thanks
 
You can use getTileItemById and use toPosition as position.
Code:
local thing = getTileItemById(toPosition, 2739).uid
if thing > 0 then
Then use thing instead of itemEx.uid.
 
You can use getTileItemById and use toPosition as position.
Code:
local thing = getTileItemById(toPosition, 2739).uid
if thing > 0 then
Then use thing instead of itemEx.uid.

This is my script at present.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(itemEx.itemid == 2739) then
        doTransformItem(itemEx.uid, 2737)
        doCreateItem(2694, 1, toPosition)
        doDecayItem(itemEx.uid)
        return true
    end
    return destroyItem(cid, itemEx, toPosition)
end

Would this work?
Code:
local thing = getTileItemById(toPosition, 2739).uid

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if thing > 0 then
        doTransformItem(thing, 2737)
        doCreateItem(2694, 1, toPosition)
        doDecayItem(thing)
        return true
    end
    return destroyItem(cid, itemEx, toPosition)
end
 
No, add it under function onUse.
Everything above function onUse (outside the function) will be loaded on startup, everything inside the function will be loaded every time you use the tool.
The parameter toPosition is the fifth parameter of function onUse, this gets the position where you use the tool, so this needs to be inside function onUse.
 
No, add it under function onUse.
Everything above function onUse (outside the function) will be loaded on startup, everything inside the function will be loaded every time you use the tool.
The parameter toPosition is the fifth parameter of function onUse, this gets the position where you use the tool, so this needs to be inside function onUse.

It works now.. Thank you :)
 
No, add it under function onUse.
Everything above function onUse (outside the function) will be loaded on startup, everything inside the function will be loaded every time you use the tool.
The parameter toPosition is the fifth parameter of function onUse, this gets the position where you use the tool, so this needs to be inside function onUse.

Okay :)

So I have a watering can that regrows jungle grass to trap monsters and stuff, but I have the same problem as with the scythe, I cannot use it on the grass when a player or monster is standing there. I followed your advice but I cannot crack it, could you give me a hand please?

This is the script:
Code:
local JUNGLE_GRASS = {2781, 3984, 2737, 2738}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(isInArray(JUNGLE_GRASS, itemEx.itemid)) then
        doTransformItem(itemEx.uid, itemEx.itemid + 1)
        doDecayItem(itemEx.uid)
        return true
    end

    return destroyItem(cid, itemEx, toPosition)
end
 
Code:
    for g = 1, #JUNGLE_GRASS do
         local thing = getTileItemById(toPosition, JUNGLE_GRASS[g]).uid
         if thing > 0 then
             doTransformItem(thing, JUNGLE_GRASS[g] + 1)
             doDecayItem(thing)
             return true
         end
     end
 
Code:
    for g = 1, #JUNGLE_GRASS do
         local thing = getTileItemById(toPosition, JUNGLE_GRASS[g]).uid
         if thing > 0 then
             doTransformItem(thing, JUNGLE_GRASS[g] + 1)
             doDecayItem(thing)
             return true
         end
     end

Code:
local JUNGLE_GRASS = {2781, 3984, 2737, 2738}

    for g = 1, #JUNGLE_GRASS do
         local thing = getTileItemById(toPosition, JUNGLE_GRASS[g]).uid
         if thing > 0 then
             doTransformItem(thing, JUNGLE_GRASS[g] + 1)
             doDecayItem(thing)
             return true
         end
     end

brings up this error:
Code:
[09/03/2015 18:03:29] [Error - Action Interface]
[09/03/2015 18:03:29] data/actions/scripts/tools/watering can.lua
[09/03/2015 18:03:29] Description:
[09/03/2015 18:03:29] attempt to index a nil value
[09/03/2015 18:03:29] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/tools/watering can.lua)
[09/03/2015 18:03:29] data/actions/scripts/tools/watering can.lua:13: '<eof>' expected near 'end'

Haha don't worry i got it working :D

Thank you so much
 
Back
Top