bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 939
- Solutions
- 7
- Reaction score
- 129
- Location
- Brazil
- YouTube
- caruniawikibr
Does anyone know why the script works but this error appears in tfs?
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local tile = Tile(toPosition)
if not tile then
return false
end
if table.contains({468, 481, 483}, target.itemid) then
target:transform(target.itemid + 1)
target:decay()
elseif target.itemid == 231 then
local randomValue = math.random(1, 100)
if target.actionid == 100 and randomValue <= 25 then
target:transform(489)
target:decay()
elseif randomValue <= 3 and player:getPosition():isInRange(posSand.fromPos, posSand.toPos) then
Game.createItem(2159, 1, toPosition)
elseif randomValue > 98 and player:getPosition():isInRange(posSand.fromPos, posSand.toPos) then
Game.createMonster("Scarab", toPosition)
end
toPosition:sendMagicEffect(CONST_ME_POFF)
elseif target.itemid == 5581 then
toPosition:sendMagicEffect(CONST_ME_POFF)
else
return false
end
return true
end