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

Lua getThingFromPos

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
969
Solutions
17
Reaction score
354
GitHub
olrios
Twitch
olrios
Code:
local thing = getThingFromPos(pos)
if thing.itemid == blablabla

I have problem and question about it to you. I have advanced script which is checking certain positions. But sometimes getThingFromPos(pos) returns error in console "Tile not found" because tile on pos doesn't exists (ex. is it in air). The script is spamming my console very hard, I'd like to add something what will stop displaying such error in my console.
 
Solution
Code:
local thing = getThingFromPos(pos)
if thing.itemid == blablabla

I have problem and question about it to you. I have advanced script which is checking certain positions. But sometimes getThingFromPos(pos) returns error in console "Tile not found" because tile on pos doesn't exists (ex. is it in air). The script is spamming my console very hard, I'd like to add something what will stop displaying such error in my console.

Try this:
Code:
if getTileThingByPos(pos).uid ~= 0 then
local thing = getThingFromPos(pos)
    if thing.itemid == blablabla
Code:
local thing = getThingFromPos(pos)
if thing.itemid == blablabla

I have problem and question about it to you. I have advanced script which is checking certain positions. But sometimes getThingFromPos(pos) returns error in console "Tile not found" because tile on pos doesn't exists (ex. is it in air). The script is spamming my console very hard, I'd like to add something what will stop displaying such error in my console.

Try this:
Code:
if getTileThingByPos(pos).uid ~= 0 then
local thing = getThingFromPos(pos)
    if thing.itemid == blablabla
 
Solution
U should make it check whether there is a tile or not. If there is then dox if there is nothing it should return smthn
 
Back
Top