• 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 Tfs 1.3 mining in lua

MrVilhelm

Mafia Penguin
Joined
Dec 11, 2020
Messages
141
Solutions
1
Reaction score
113
Location
Sweden
GitHub
MrVilhelm
Hi! Im a newbie ot dev and today I decided to test my wings in lua. Ehh well yea it didnt go as planned 😅

XML:
    <action itemid="2382" script="tools/pickaxe.lua" />

Lua:
local ore = 5880
local stone = 1358

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target == stone then
        player:addItem(ore,1)
    else
        return false
    end
end

So I did that, I want it so that when I use item 2382 on item "stone" = id 1358 I get "ore" = id 5880. But this script I have atm only gives the return false. Why? Im guessing if target aint a thing, but how would I tackel this?
 
how should the game know 1358 is itemId?

Lua:
if target:getId() == stone then
 
Last edited:
Solution
Back
Top