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

0 Members and 1 Guest are viewing this topic.

Jeffy

  • Jr. Member
  • **
  • Posts: 74
  • I hate greenbeans
    • View Profile
    • Twitch
    • Awards
  • Xbox: Comrade Creepz
  • Steam: comradecreepzyt
[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

AlienizdPixel

  • Tester
  • Supreme Member
  • *****
  • Posts: 2719
  • Hello
  • Awards 3 years on site Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site Was in the top 10 of the forum stats page as of 4/12/15 1 year on site
    • View Profile
    • Awards
  • Xbox: A1ienizdPixe1
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: 862
  • Keyboard not found. Press F1 to continue.
  • Awards Awarded to exemplary forum members 2 years on site 4 years on site 3 years on site 1 year on site
    • 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?

Jeffy

  • Jr. Member
  • **
  • Posts: 74
  • I hate greenbeans
    • View Profile
    • Twitch
    • Awards
  • Xbox: Comrade Creepz
  • Steam: comradecreepzyt
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

Jeffy

  • Jr. Member
  • **
  • Posts: 74
  • I hate greenbeans
    • View Profile
    • Twitch
    • Awards
  • Xbox: Comrade Creepz
  • Steam: comradecreepzyt
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

Dryym

  • Supreme Member
  • *****
  • Posts: 4334
  • 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 3 years on site Site art contributions/TPs in-game/Contest winners 1 year on site
    • 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

Jeffy

  • Jr. Member
  • **
  • Posts: 74
  • I hate greenbeans
    • View Profile
    • Twitch
    • Awards
  • Xbox: Comrade Creepz
  • Steam: comradecreepzyt
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.
 

TheDestinedCrab

  • Legendary Member
  • *****
  • Posts: 1370
  • Did you see that? Me neither.
  • Awards 3 years on site Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site 1 year on site
    • 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!