Jfrye
Mapper, trying to learn scripting
Hey again. Im using TFS 1.1, client 10.77.
Now I seem to be having an issue with hole id 392.
It does not matter what value i set for duration, the hole does not want to close. It is a hidden hole, in which you have to use a pick to open it. so the normal ground tile has aid 777.
Script used to open the hole.
I even tried changing the ticks from 30 to 1 at the top of the script, and that does nothing either.
This duration on this pitfall works great. Value was changed to 6 for testing purposes. Anyone have any idea why the hole with id 392 is giving me issues?
Now I seem to be having an issue with hole id 392.
Code:
<item id="392" article="a" name="hole">
<attribute key="decayTo" value="354" />
<attribute key="duration" value="1" />
<attribute key="floorchange" value="down" />
</item>
It does not matter what value i set for duration, the hole does not want to close. It is a hidden hole, in which you have to use a pick to open it. so the normal ground tile has aid 777.
Script used to open the hole.
Code:
local aID = 777
local ticks = 30
local GRASS = {4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4529, 4540, 4541, 4567, 4568, 4569, 4756}
local DIRT = {351, 352, 353, 354, 355}
local SNOW = {671, 6683, 6684, 6685, 6686, 7002}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local toPositions = {x=toPosition.x, y=toPosition.y, z=toPosition.z, stackpos=0}
if itemEx.actionid == aID then
if isInArray(GRASS, itemEx.itemid) then
doTransformItem(itemEx.uid,470)
doDecayItemTo(toPositions, itemEx.itemid, ticks)
elseif isInArray(DIRT, itemEx.itemid) then
doTransformItem(itemEx.uid,392)
doDecayItemTo(toPositions, itemEx.itemid, ticks)
elseif itemEx.itemid == 231 then
doTransformItem(itemEx.uid,482)
doDecayItemTo(toPositions, itemEx.itemid, ticks)
elseif isInArray(SNOW, itemEx.itemid) then
doTransformItem(itemEx.uid,485)
doDecayItemTo(toPositions, itemEx.itemid, ticks)
else
doCreateItem(3324, 1, toPosition)
doDecayItemTo({x=toPosition.x, y=toPosition.y, z=toPosition.z, stackpos=1}, 0, ticks)
end
elseif itemEx.itemid == 7200 then
doTransformItem(itemEx.uid,7236)
end
return true
end
I even tried changing the ticks from 30 to 1 at the top of the script, and that does nothing either.
Code:
<item id="294" article="a" name="pitfall">
<attribute key="floorchange" value="down" />
<attribute key="decayTo" value="293" />
<attribute key="duration" value="6" />
</item>