local pos = {
{x=1000, y=1000, z=7},
{x=999, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
}
function onThink(interval, lastExecution)
if getGlobalStorageValue(10245) == -1 then
for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1512).uid
doTransformItem(pos2, 1513)
end
setGlobalStorageValue(10245, 1)
elseif getGlobalStorageValue(10245) == 1 then
for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1513).uid
doTransformItem(pos2, 1512)
end
setGlobalStorageValue(10245, -1)
end
return true
end
i know how to make it work by onstep i need it work if player walk on or noYou need to find the 'hidden trap' tile id of that thing and then do some onStep function that would deal damage to the user and transform it to hidden one.
Thats the way I would do that.
bro i need it work like globalevent every one min appear and disappearcheck cid for isPlayer()
The easiest way to do this is using a movement script, that you already know how to do (as you said) and using "decay to" in items.xml to make it become the first item again, before it triggers.bro i need it work like globalevent every one min appear and disappear
local pos = {
{x=1000, y=1000, z=7},
{x=999, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
}
function onThink(interval, lastExecution)
if getGlobalStorageValue(10245) == -1 then
for i = 1, #pos do
local pos2 = getThingfromPos(pos[i]).uid
doTransformItem(pos2, 1513)
end
setGlobalStorageValue(10245, 1)
elseif getGlobalStorageValue(10245) == 1 then
for i = 1, #pos do
local pos2 = getThingfromPos(pos[i]).uid
doTransformItem(pos2, 1512)
end
setGlobalStorageValue(10245, -1)
end
return true
end
local pos = {
{x=1000, y=1000, z=7},
{x=999, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
}
function onThink(interval, lastExecution)
if getGlobalStorageValue(10245) == -1 then
for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1512).uid
doTransformItem(pos2, 1513)
end
setGlobalStorageValue(10245, 1)
elseif getGlobalStorageValue(10245) == 1 then
for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1513).uid
doTransformItem(pos2, 1512)
end
setGlobalStorageValue(10245, -1)
end
return true
end
hello guys i have one question
how to make something like this work auto
![]()
tfs 0.4
???
bump
pumb
<item id="1512" name="strange holes">
<attribute key="decayTo" value="1513"/>
<attribute key="duration" value="1"/>
</item>
<item id="1513" name="spikes">
<attribute key="decayTo" value="1512"/>
<attribute key="duration" value="3"/>
</item>
<attribute key="healthGain" value="-60"/>
function onStepIn(cid, item, pos)
if(item.itemid == 1513) then
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -1, -60, CONST_ME_NONE)
return true
end
end
work finethis should work fine
Code:local pos = { {x=1000, y=1000, z=7}, {x=999, y=1000, z=7}, {x=1000, y=1000, z=7}, {x=1000, y=1000, z=7}, {x=1000, y=1000, z=7}, {x=1000, y=1000, z=7}, } function onThink(interval, lastExecution) if getGlobalStorageValue(10245) == -1 then for i = 1, #pos do local pos2 = getTileItemById(pos[i],1512).uid doTransformItem(pos2, 1513) end setGlobalStorageValue(10245, 1) elseif getGlobalStorageValue(10245) == 1 then for i = 1, #pos do local pos2 = getTileItemById(pos[i],1513).uid doTransformItem(pos2, 1512) end setGlobalStorageValue(10245, -1) end return true end