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

Lua Create stone on ground

GOD Wille

Excellent OT User
Joined
Jan 11, 2010
Messages
2,826
Solutions
2
Reaction score
815
Location
Sweden
tfs 0.4

Code:
local config = {
    pos1 = getCreaturePosition(cid),
    bushId = 1285,
}

function onSay(cid, words, param, channel)
    if(param == '') and
        getTileItemById(config.pos1, config.bushId).uid <= 0 then
    doTileAddItemEx(config.pos1, config.bushId)
    end
        return true
    end



and i do get tile not found error, why?
 
Because there is no uid that is less then or equal to 0 ( <= )
Code:
if(param == '') and getTileItemById(config.pos1, config.bushId).uid <= 0 then

Plus you can't call getCreaturePosition(cid) in a table outside of an interface like onSay
 
Last edited:
Because there is no uid that is less then or equal to 0 ( <= )
Code:
if(param == '') and getTileItemById(config.pos1, config.bushId).uid <= 0 then

Plus you can't call getCreaturePosition(cid) in a table outside of an interface like onSay
If you use getTileItemById(pos, itemid).uid, it will return 0 if the item with that itemid isn't there on that position, if the item is there, it will return the uniqueid of the item.
So you can use this to check if an item with a certain itemid is on a certain position.
 
Back
Top