MrVilhelm
Mafia Penguin
Hi! Im a newbie ot dev and today I decided to test my wings in lua. Ehh well yea it didnt go as planned
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?
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?