Endless teleporting?
#1

This timer is teleporting me back and forth repeatedly.

Reply
#2

Is Portal_Timer called by a repeating timer?
Reply
#3

Quote:
Originally Posted by [KHK]Khalid
Посмотреть сообщение
Is Portal_Timer called by a repeating timer?
Yes. Which is why I created the boolean Portalled to tell if they had already went through the portal. Once they leave the portal range (currently 3 (feet?)) then it changes to tell that the player can portal again once entering. Corrected a typo up top.
Reply
#4

Is it teleporting for the Point1 to the Point2 then from the Point2 to the Point1 and repeating?
Reply
#5

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Is it teleporting for the Point1 to the Point2 then from the Point2 to the Point1 and repeating?
Yup. Which is why the boolean should have been preventing endless teleporting.
Reply
#6

So your script is supposed to handle too many portals (as the loop tells), isn't it? Well, I bet that this loop can never check any other portals than ID (i) 0 due to the way you use return inside the loop. Simply remove the return in else statement, this might not solve your main problem though, but it will surely make it check other portals.
Reply
#7

Quote:
Originally Posted by [KHK]Khalid
Посмотреть сообщение
So your script is supposed to handle too many portals (as the loop tells), isn't it? Well, I bet that this loop can never check any other portals than ID (i) 0 due to the way you use return inside the loop. Simply remove the return in else statement, this might not solve your main problem though, but it will surely make it check other portals.
Right. I should be using break rather.

EDIT: Resolved, thanks guys.
Reply
#8

Quote:
Originally Posted by Aerotactics
Посмотреть сообщение
Right. I should be using break rather.
On the else statement? No, don't use break or return. You should let the loop continue checking other portals (tell me if you don't get this part). On if or else-if statements, it doesn't matter since you have no code after the loop so break or return both of them will get the job done.
Reply
#9

Quote:
Originally Posted by [KHK]Khalid
Посмотреть сообщение
On the else statement? No, don't use break or return. You should let the loop continue checking other portals (tell me if you don't get this part). On if or else-if statements, it doesn't matter since you have no code after the loop so break or return both of them will get the job done.
Yup, worked this part out on my own.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)