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

[Solved] How to make tile Compressed

Chestnutz

Senior Member
Joined
May 19, 2010
Messages
344
Reaction score
20
Hey guys,

In my server i have an event wich requires the item:
21:03 You see a stone tile.
It seems to be a switch.
ItemID: [426].

I need to make it so the switch stays pressed in and stays in when you walk off it and will stay down if you or a monster walks on it again, the script resets the area. does anyone know how?

Rep++ :)
 
I don't understand what you mean. So a person steps on tile id 426, then it becomes 425, even when a the person walks away or walks on it again it still stays 425? How does this resets an area?
 
like, after a player has either died or completed the game all the tiles would be 425. so when the next player starts its already set so al lthe tiles go back to 426, its just a matter of getting the tiles to stay on 425 while the first player is playing

- - - Updated - - -

I don't understand what you mean. So a person steps on tile id 426, then it becomes 425, even when a the person walks away or walks on it again it still stays 425?
Yes
 
LUA:
function onStepIn(cid, item, pos, frompos)
	if item.itemid == 426 then
		doTransformItem(item.uid, 425)
	end
	return true
end

With same action id
LUA:
function onStepOut(cid, item, pos, frompos)
	return true
end
 
data/actions/scripts/tile add it to that?
xml code:
<action actionid="???" event="script" value="tile.lua"/> ?
were does second one go? ;o

LUA:
function onStepIn(cid, item, pos, frompos)
	if item.itemid == 426 then
		doTransformItem(item.uid, 425)
	end
	return true
end

With same action id
LUA:
function onStepOut(cid, item, pos, frompos)
	return true
end
 
StepIn and StepOut are movements, so they go in movements.xml.
Example:
XML:
<movevent type="StepIn" actionid="5000" event="script" value="tilein.lua"/>
<movevent type="StepOut" actionid="5000" event="script" value="tileout.lua"/>
 
It's 2 files, you can see that in my xml example.

@Akkz, I thought your tiles didn't got pressed at all, this is about letting tiles stay pressed. If you also have this problem, then adding the stepout file with the same action id should work (this make the tile stay 425 when you walk out of the tile).
 
Last edited:
No you can't, just use the same action id and if the tile already gets pressed when you walk on but just doesn't stay that way you can also only use the stepout script.
 
I got theese now in Movements.xml
Code:
  	<movevent type="StepIn" actionid="5301" event="script" value="pacman.lua" />
 	<movevent type="StepIn" actionid="7392" event="script" value="pacman.lua" /> 
	<movevent type="StepOut" actionid="5301" event="script" value="pacman.lua" />
still doesn't work
 
No I can't, because I don't know which name you gave to your StepOut script.

@ your edit
You can't have 2 scripts with the same name :p, so the pacman.lua can't be also the name of the of to StepOut script.
 
If you check my thread, thats the only scripts I have... http://otland.net/f16/pacman-event-177412/ and here is the xml I sent you...
Code:
  	<movevent type="StepIn" actionid="5301" event="script" value="pacman.lua" />
 	<movevent type="StepIn" actionid="7392" event="script" value="pacman.lua" /> 
	<movevent type="StepOut" actionid="5301" event="script" value="pacman.lua" />

This is all I have!!
 
lol
XML:
<movevent type="StepOut" actionid="5301" event="script" value="pacman.lua" />
This line is wrong, change pacman.lua to the name of the StepOut script.
 
Back
Top