Hello there guys, I am currently messing around with a pick.lua script that is causing the floor tile to be removed rather than the created hole. Very strange.
Description of what happens: You will pick the hole, it works fine until the 120 second tick counter is up. Then it removes the ground tile, rather than the hole "created itemid" and causes the tile to become un-walkable.
Distro: OTHire released by Ezzz in the downloads section of OTLand.
Link: https://github.com/TwistedScorpio/OTHire/
LUA Action Script for Pick Holes:
Any help is greatly appreciated and for anyone wondering to replicate for sure test DIRT = {351, 352, 353, 354, 355} as that is what I was testing. Although Im sure it does it for every ground type
Description of what happens: You will pick the hole, it works fine until the 120 second tick counter is up. Then it removes the ground tile, rather than the hole "created itemid" and causes the tile to become un-walkable.
Distro: OTHire released by Ezzz in the downloads section of OTLand.
Link: https://github.com/TwistedScorpio/OTHire/
LUA Action Script for Pick Holes:
Code:
function onUse(cid, item, frompos, item2, topos)
aID = 55556 --Action Id the ground tile must have to turn into a hole.
ticks = 120 --How many seconds the hole will last before turning into a normal tile again
topos = {x=topos.x, y=topos.y, z=topos.z}
GRASS = {4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4529, 4540, 4541, 4567, 4568, 4569, 4756}
DIRT = {351, 352, 353, 354, 355}
SNOW = {671, 6683, 6684, 6685, 6686, 7002}
DENY = {383, 384, 385, 392, 418, 469, 470, 482, 484, 485, 489}
if item2.actionid == aID then
if isInArray(GRASS, item2.itemid) == 1 then
doTransformItem(item2.uid,470)
doDecayItemTo(topos, item2.itemid, ticks)
elseif isInArray(DIRT, item2.itemid) == 1 then
doTransformItem(item2.uid,383)
doDecayItemTo(topos, item2.itemid, ticks)
elseif item2.itemid == 231 then
doTransformItem(item2.uid,482)
doDecayItemTo(topos, item2.itemid, ticks)
elseif isInArray(SNOW, item2.itemid) == 1 then
doTransformItem(item2.uid,485)
doDecayItemTo(topos, item2.itemid, ticks)
elseif isInArray(DENY, item2.itemid) == 1 then
doPlayerSendTextMessage(cid,23,"Sorry! not possible.")
else
doCreateItem(3324, 1, topos)
doDecayItemTo(topos, 0, ticks)
end
elseif item2.itemid == 7200 then
doTransformItem(item2.uid,7236)
elseif item2.actionid == 8090 and item2.itemid == 1304 then
CHANCESTONE = math.random(1,10)
PLAYERHEALTH = math.random(10,67)
if CHANCESTONE <= 2 then
doTransformItem(item2.uid,383)
doSendMagicEffect(topos, 3)
doCreatureAddHealth(cid, -PLAYERHEALTH)
else
doCreatureAddHealth(cid, -PLAYERHEALTH)
doSendMagicEffect(topos, 2)
end
end
return true
end
Any help is greatly appreciated and for anyone wondering to replicate for sure test DIRT = {351, 352, 353, 354, 355} as that is what I was testing. Although Im sure it does it for every ground type