Total Miner Forums

Total Miner => Creative Features => Topic started by: Oakley on July 27, 2017, 08:53:54 AM

Title: Stuck in TP loop, please help.
Post by: Oakley on July 27, 2017, 08:53:54 AM
(https://s12.postimg.org/44yopwhnh/IMG_20170727_132314.jpg)

Hello, what you're seeing above is a series of rooms that I made, each room that you see has another room underneath it so there are 24 rooms in total. Each room will have a column in the center that can be walked into and there will be a script block in the center acting as pressure plates so when it is stepped on in the top room, it will teleport me to the bottom room. The problem with using script blocks to do this is that it makes me get stuck in a teleport loop that makes me constantly teleport from room to room. So is there any way to stop this from happening using script block or would it be better to use zones?
Thanks
Title: Re: Stuck in TP loop, please help.
Post by: AlienizdPixel on July 27, 2017, 09:53:58 AM
If you are not wanting to change the positioning of the Script Blocks, adding a Menu or MessageBox command to require a player to confirm that they are wanting to teleport would counter the loop.
Title: Re: Stuck in TP loop, please help.
Post by: Fuertey on July 27, 2017, 10:49:51 AM
Unless i'm missing something, couldn't you just change the destination co-ordinates so that it teleports you to 2-3 blocks away from the center column?
Title: Re: Stuck in TP loop, please help.
Post by: Oakley on July 27, 2017, 11:02:26 AM
Unless i'm missing something, couldn't you just change the destination co-ordinates so that it teleports you to 2-3 blocks away from the center column?

I thought about doing that, but I want the teleport destination to be exactly in the middle. The columns are around the center block in the rooms
Title: Re: Stuck in TP loop, please help.
Post by: Oakley on July 27, 2017, 11:08:52 AM
If you are not wanting to change the positioning of the Script Blocks, adding a Menu or MessageBox command to require a player to confirm that they are wanting to teleport would counter the loop.

Oh yeah I hadn't thought of that, I'm a bit rusty on the MessageBox command but I'll give it a try

Thanks
Title: Re: Stuck in TP loop, please help.
Post by: Platinum Dryym on July 27, 2017, 02:02:25 PM
If you are not wanting to change the positioning of the Script Blocks, adding a Menu or MessageBox command to require a player to confirm that they are wanting to teleport would counter the loop.

Oh yeah I hadn't thought of that, I'm a bit rusty on the MessageBox command but I'll give it a try

Thanks

Alternatively, If you want them to spawn in the centre whenever you enter the room, You could have it give you a history when you teleport and remove it a second later. Then you just check to make it so that you can only teleport if you do not have the history.

Then, As a failsafe, I would make it so that it removes the history when you step on it so that if it bugs you will not be stuck in the room. This keeps gameplay seamless and allows you to do exactly what you want.
Title: Re: Stuck in TP loop, please help.
Post by: Oakley on July 27, 2017, 03:25:08 PM
If you are not wanting to change the positioning of the Script Blocks, adding a Menu or MessageBox command to require a player to confirm that they are wanting to teleport would counter the loop.

Oh yeah I hadn't thought of that, I'm a bit rusty on the MessageBox command but I'll give it a try

Thanks

Alternatively, If you want them to spawn in the centre whenever you enter the room, You could have it give you a history when you teleport and remove it a second later. Then you just check to make it so that you can only teleport if you do not have the history.

Then, As a failsafe, I would make it so that it removes the history when you step on it so that if it bugs you will not be stuck in the room. This keeps gameplay seamless and allows you to do exactly what you want.

It would probably be easier with histories, but I'm not quite sure if the script I have made is correct.

This is what I have done:

If
HasHistory [tp]  [player] [false]
Then
History [tp] [player] [+1]
Notify [teleporting, please wait...] [local]
Wait [1700]
Notify [5] [local]
Wait [1000]
Notify [4] [local]
Wait [1000]
Notify [3] [local]
Wait [1000]
Notify [2] [local]
Wait [1000]
Notify [1] [local]
Wait [1000]
Teleport [player] [673,269,176]

That is what I did so far but I'm not sure that this is correct, and don't know what to put next.
 
Title: Re: Stuck in TP loop, please help.
Post by: TheDestinedCrab on July 27, 2017, 04:17:58 PM
You need to set the history back to false after they have teleported. I'm rusty on scripting but I believe after that you should be done.