Figaro
Banned User
Hey i need script when i step to tile, it make stone to (expample)100x 100y 7z and when step out it removs that stone
Rep++ to that who post working script
Im using newest tfs distro.
local config =
{
stoneID = 45454,
pos = {x = 100, y = 100, z = 7}
}
function onStepIn(cid, item, position, fromPosition)
doCreateItem(config.stoneID, 1, config.pos)
return TRUE
end
function onStepOut(cid, item, pos)
doRemoveItem(getThingfromPos(config.pos).uid, 1)
return TRUE
end
<movevent type="StepIn" actionid="10203" event="script" value="removestone.lua"/>
<movevent type="StepOut" actionid="10203" event="script" value="removestone.lua"/>
Hmm im thinking is this possible? I dont want do new script to each training place, so if that tile action id is 6961 and stone tp pos 100x 100y 7z and next room tile action id 6962 and stone tp pos 104x 100y 7z so how i set multiple stone tp pos with diferent action id to that script?
local config = {
stone = 4321,
pos = {
[6961] = { x = 100, y = 100, z = 7, stackpos = ??? },
[6962] = { x = 103, y = 100, z = 7, stackpos = ??? }
}
}
local function getPosition(action)
for aid, pos in pairs(config.pos) do
if aid == action then
return pos
end
end
end
function onStepIn(cid, item, position, fromPosition)
doCreateItem(config.stone, 1, getPosition(item.actionid))
return TRUE
end
function onStepOut(cid, item, pos)
doRemoveItem(getThingfromPos(getPosition(item.actionid)).uid, 1)
return TRUE
end