• 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 [TFS 0.4] Moving ground

Blade33711

Member
Joined
Aug 6, 2012
Messages
133
Solutions
1
Reaction score
5
Location
Poland
How to swap positions 1 of 2? So to swap into every five seconds.
srp94e.png
 
You can't really swap the tiles, but you can "Simulate" that you swapped the tiles.

First, you'd mainly use the function doRelocate(fromPos, toPos). But, there is a problem with this.

If you Relocate Tile 1, to Tile 2, then EVERYTHING is on Tile 2, So you'd have to have what I call a "Utility Tile" that you place somewhere unreachable on the map. (I usually just use position {X=10, y=10, z=0})

Then what you do is:
  1. Relocate Tile 1 to the "Utility Tile"
  2. Relocate Tile 2 to Tile 1
  3. Relocate "Utility Tile" to Tile 2
I do not think it Relocates the ground tile, or borders (if you have them) so you'd have to move those manually (Probably just Grab the itemid from both tiles and then doTransform them after making a switch)

Hopefully this helps. I am too lazy to write a whole script for you, but this should be more than enough information to get you started.
 
Back
Top