Player TP detector

Hello everyone,

I am currently working on a server sided TP detector which runs every 0.5 seconds. It checks for 2 different things, first is the distance travelled (In my case its 35 studs after testing a bunch) and the second is the time since last death. And my code is below:

if TimeIfDied >= 0.5 and PlrDistance <= threshold then
			print("All Good")
		elseif TimeIfDied <= 0.5 then
			print("Had Died")
		elseif TimeIfDied >= 0.8 and PlrDistance >= threshold+0.1 then
			print("Something is wrong")
			print(TimeIfDied)
			print(PlrDistance)
		end

I expect if the player has died the time between now and the time of death will be less then 0.5 seconds since this script is ran every 0.5 seconds, but after that the problem arises that when a player has died the last statement is activated after the first statement is activated. So in summary when a player has died it outputs that the player has died, then All Good then Something is wrong. While testing on this bug I find that the position from last location is to blame, but since after death it does show everything is good why does it revert back to statement 3?

I am sorry if my explanation is confusing, you can lmk and I will try to make it a bit more clear or try and provide an explanation with a video.

Update: It was just an irregularity with the checks its all fixed now!