• 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!

Lua Footprints in the snow are creating only from ID 670 and 6594

ligus

New Member
Joined
Apr 26, 2010
Messages
253
Reaction score
0
Hey, I have problem. Only when someone stand on ID 670 or 6594 then footprint is created. How can I change it to make footprint from all snow tiles (6580-6593)?

movements.xml
Code:
<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepIn" itemid="6594" event="script" value="snow.lua"/>

snow.lua
Code:
TILE_SNOW = 670
TILE_FOOTPRINT_I = 6594
TILE_FOOTPRINT_II = 6598

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then
		return true
	end

	if(item.itemid == TILE_SNOW) then
		doTransformItem(item.uid, TILE_FOOTPRINT_I)
		doDecayItem(item.uid)
	elseif(item.itemid == TILE_FOOTPRINT_I) then
		doTransformItem(item.uid, TILE_FOOTPRINT_II)
		doDecayItem(item.uid)
	else
		doTransformItem(item.uid, TILE_FOOTPRINT_I)
	end

	return true
end
 
just put them in tables and then use doTransformItem(item.uid, Tiles[item.itemid]) that and make sure all decay ids are correct
LUA:
Tiles ={
[670] = id1,
[xxxx] = id2,
...
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then
		return true
        else
                doTransformItem(item.uid, Tiles[item.itemid])
		doDecayItem(item.uid)
	end
	return true
end

<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepIn" itemid="firstid-lastid" event="script" value="snow.lua"/>
example: <movevent type="StepIn" itemid="6594-6596" event="script" value="snow.lua"/>

I don't have time to check ids so do it yourself
 
Last edited:
It's really weird, I made for test:

Code:
<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepIn" itemid="6580-6582" event="script" value="snow.lua"/>

Code:
Tiles ={
[670] = 6594,
[6580] = 6595,
[6581] = 6596,
[6582] = 6597
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then
		return true
        else
                doTransformItem(item.uid, Tiles[item.itemid])
		doDecayItem(item.uid)
	end
	return true
end

And server started with footprints... Items 6580, 6581, 6582 are automatically changed to 6595, 6596, 6597. What's wrong?

- - - Updated - - -

Does anyone know whats the problem?
 
did you make sure that your decay isn't set up backwards? you have to set ex. id 6594 decay not item 670.

Or is it when you log in on snow they all change to these?
 
Last edited:
did you make sure that your decay isn't set up backwards? you have to set ex. id 6594 decay not item 670.
Yes, I'm sure its correct.

Or is it when you log in on snow they all change to these?
I run TFS and server starts with footprints :/
Server doesn't start with footprints when I'm using scripts from first post, but these scripts works only for ID 670->6594 and 6594->6598
 
well try this maybe if you are more strict it will work
LUA:
Tiles ={
	[670] = 6594,
	[6580] = 6595,
	[6581] = 6596,
	[6582] = 6597
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then return true end
	position.stackpos = 0
	snow = getThingfromPos(position)
	doTransformItem(snow.uid, v)
	doDecayItem(snow.uid)
	return true
end


if that doesn't work then try this, which is a bit more strict
LUA:
Tiles ={
	[670] = 6594,
	[6580] = 6595,
	[6581] = 6596,
	[6582] = 6597
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then return true end
	for k, v in pairs(Tiles) do
		if(k == item.itemid) then
			position.stackpos = 0
			snow = getThingfromPos(position)
			doTransformItem(snow.uid, v)
			doDecayItem(snow.uid)
		end
	end
	return true
end
 
Last edited:
XML:
	<!-- Snow footprint tiles -->
	<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
	<movevent type="StepIn" fromid="6580" toid="6594" event="script" value="snow.lua"/>

LUA:
TILE_SNOW = 670
TILE_FOOTPRINT_I = 6594
TILE_FOOTPRINT_II = 6598

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then
		return true
	end

	if(item.itemid == TILE_SNOW) then
		doTransformItem(item.uid, TILE_FOOTPRINT_I)
		doDecayItem(item.uid)
	elseif(item.itemid == TILE_FOOTPRINT_I) then
		doTransformItem(item.uid, TILE_FOOTPRINT_II)
		doDecayItem(item.uid)
	else
		doTransformItem(item.uid, TILE_FOOTPRINT_I)
	end

	return true
end
 
well try this maybe if you are more strict it will work
LUA:
Tiles ={
	[670] = 6594,
	[6580] = 6595,
	[6581] = 6596,
	[6582] = 6597
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then return true end
	position.stackpos = 0
	snow = getThingfromPos(position)
	doTransformItem(snow.uid, v)
	doDecayItem(snow.uid)
	return true
end
Server started with errors:
1KQqNA.jpg






if that doesn't work then try this, which is a bit more strict
LUA:
Tiles ={
	[670] = 6594,
	[6580] = 6595,
	[6581] = 6596,
	[6582] = 6597
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then return true end
	for k, v in pairs(Tiles) do
		if(k = item.itemid) then
			position.stackpos = 0
			snow = getThingfromPos(position)
			doTransformItem(snow.uid, v)
			doDecayItem(snow.uid)
		end
	end
	return true
end
Error:
2M2Cno.jpg






XML:
	<!-- Snow footprint tiles -->
	<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
	<movevent type="StepIn" fromid="6580" toid="6594" event="script" value="snow.lua"/>

LUA:
TILE_SNOW = 670
TILE_FOOTPRINT_I = 6594
TILE_FOOTPRINT_II = 6598

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then
		return true
	end

	if(item.itemid == TILE_SNOW) then
		doTransformItem(item.uid, TILE_FOOTPRINT_I)
		doDecayItem(item.uid)
	elseif(item.itemid == TILE_FOOTPRINT_I) then
		doTransformItem(item.uid, TILE_FOOTPRINT_II)
		doDecayItem(item.uid)
	else
		doTransformItem(item.uid, TILE_FOOTPRINT_I)
	end

	return true
end
Server started with footprints:
3XuFy1.jpg




Any idea? :/
 
Code:
Tiles ={
	[670] = 6594,
	[6580] = 6595,
	[6581] = 6596,
	[6582] = 6597,
	[6583] = 6598,
	[6584] = 6599,
	[6585] = 6600,
	[6586] = 6601,
	[6587] = 6602,
	[6588] = 6603,
	[6589] = 6604,
	[6590] = 6605,
	[6591] = 6606,
	[6592] = 6607,
	[6593] = 6608,
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then return true end
	for k, v in pairs(Tiles) do
		if(k == item.itemid) then
			position.stackpos = 0
			snow = getThingfromPos(position)
			doTransformItem(snow.uid, v)
			doDecayItem(snow.uid)
		end
	end
	return true
end


Code:
<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepIn" itemid="6580-6593" event="script" value="snow.lua"/>

And server starts with footprints :/

Also I tried all scripts from your link and server starts with footprints too...
 
You can try moving the tiles array into the function, if that doesn't work them you'll have to remove the array and do them 1 by 1 in the script like the first script in the first post but for every tile
 
Back
Top