bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 928
- Solutions
- 7
- Reaction score
- 127
- Location
- Brazil
- YouTube
- caruniawikibr
anyone help with shovel script? I would like it to work normally in the holes, but there are places in the desert that I need to open the sand, the problem is that now all the normal holes are turning into sand and then the area hole turns into sand again
Lua:
local holes = {468, 481, 483}
local sandHoles = {231} -- add sand ids
local sandAID = 2554
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local tile = Tile(toPosition)
if not tile then
return false
end
local ground = tile:getGround()
if not ground then
return false
end
local groundId = ground:getId()
if table.contains(holes, groundId) or (ground:getActionId() == sandAID and table.contains(sandHoles, groundId)) then
ground:transform(489)
ground:decay()
toPosition.z = toPosition.z + 1
tile:relocateTo(toPosition)
elseif groundId == 231 then
local randomValue = math.random(1, 100)
if randomValue == 1 then
Game.createItem(2159, 1, toPosition)
elseif randomValue > 95 then
Game.createMonster("Scarab", toPosition)
end
toPosition:sendMagicEffect(CONST_ME_POFF)
else
return false
end
return true
end