Author Topic: [Scripts] Stuck in TP loop, please help.  (Read 487 times)

0 Members and 1 Guest are viewing this topic.

Oakley

  • Jr. Member
  • **
  • Posts: 69
  • Have a great day :)
    • View Profile
    • Check me out on Twitch
    • Awards
  • Xbox: MisterCreeperX
[Scripts] Stuck in TP loop, please help.
« on: July 27, 2017, 08:53:54 AM »


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
_
__
___
____
_____
______
_____
____
___
__
_

Click HERE to join my discord server.

AlienizdPixel

  • Tester
  • Supreme Member
  • *****
  • Posts: 2612
  • Hello
  • Awards 3 years on site+600 posts Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: A1ienizdPixe1
  • Steam: Alienizd
Re: Stuck in TP loop, please help.
« Reply #1 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.
-Alionz

Fuertey

  • Elite Member
  • *****
  • Posts: 749
  • Keyboard not found. Press F1 to continue.
  • Awards Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: Fuertey
  • Steam: Fuertey
Re: Stuck in TP loop, please help.
« Reply #2 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?



Oakley

  • Jr. Member
  • **
  • Posts: 69
  • Have a great day :)
    • View Profile
    • Check me out on Twitch
    • Awards
  • Xbox: MisterCreeperX
Re: Stuck in TP loop, please help.
« Reply #3 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
_
__
___
____
_____
______
_____
____
___
__
_

Click HERE to join my discord server.

Oakley

  • Jr. Member
  • **
  • Posts: 69
  • Have a great day :)
    • View Profile
    • Check me out on Twitch
    • Awards
  • Xbox: MisterCreeperX
Re: Stuck in TP loop, please help.
« Reply #4 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
_
__
___
____
_____
______
_____
____
___
__
_

Click HERE to join my discord server.

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4241
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Stuck in TP loop, please help.
« Reply #5 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.

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

Oakley

  • Jr. Member
  • **
  • Posts: 69
  • Have a great day :)
    • View Profile
    • Check me out on Twitch
    • Awards
  • Xbox: MisterCreeperX
Re: Stuck in TP loop, please help.
« Reply #6 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.
 
_
__
___
____
_____
______
_____
____
___
__
_

Click HERE to join my discord server.

TheDestinedCrab

  • Legendary Member
  • *****
  • Posts: 1299
  • Did you see that? Me neither.
  • Awards 3 years on site+600 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
Re: Stuck in TP loop, please help.
« Reply #7 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.
Thanks Gold Knight for the amazing sig!