• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

OnStep in createstone

Figaro

Banned User
Joined
Jun 25, 2008
Messages
275
Reaction score
0
Location
696E 2079 6F75 7220 6265 64
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.
 
LUA:
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
 
PHP:
<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?
 
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?

Code:
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

Try like this.
 
Back
Top