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

Lua [movements] snow > Transform Item > Transform to snow again

Michaeel

New Member
Joined
Mar 6, 2009
Messages
272
Reaction score
1
Hey, I have problem with snow.
not all traces of the snow disappear :(

movements/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

movements.xml
Code:
	<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
	<movevent type="StepIn" itemid="6586" event="script" value="snow.lua"/>
	<movevent type="StepIn" itemid="6584" event="script" value="snow.lua"/>
	<movevent type="StepIn" itemid="6589" event="script" value="snow.lua"/>	
	<movevent type="StepIn" itemid="6587" event="script" value="snow.lua"/>	
	<movevent type="StepIn" itemid="6588" event="script" value="snow.lua"/>	
	<movevent type="StepIn" itemid="6581" event="script" value="snow.lua"/>	
	<movevent type="StepIn" itemid="6582" event="script" value="snow.lua"/>		
	<movevent type="StepIn" itemid="6590" event="script" value="snow.lua"/>	
	<movevent type="StepIn" itemid="6591" event="script" value="snow.lua"/>
	<movevent type="StepIn" itemid="6592" event="script" value="snow.lua"/>	
	<movevent type="StepIn" itemid="6593" event="script" value="snow.lua"/>	
	<movevent type="StepIn" itemid="6594" event="script" value="snow.lua"/>
	<movevent type="StepIn" itemid="6580" event="script" value="snow.lua"/>
	<movevent type="StepIn" itemid="6588" event="script" value="snow.lua"/>
	<movevent type="StepIn" itemid="6585" event="script" value="snow.lua"/>
 
Hey, I have problem with snow.
not all traces of the snow disappear :(

movements/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)
	[B][COLOR="Red"]elseif[/COLOR][/B](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

movements.xml

elseif

I guess it either should be else if, or else
 

Similar threads

Back
Top