Does anyone know why tping doesnt work 10 percent of the time

im so lost, ive tried everything, and even when the player hasnt recently respawned and didnt just load in, 10 percent of the time it doesnt tp the player even tho it prints teleported player, it makes no sence

for i = 1, #module.playing do
		delay(0, function()
			local plr = config.ph.get_player_instance(module.playing[i])
			if plr and config.ph.player_info[plr.Name] and config.ph.player_info[plr.Name].isdead or plr and plr.Character and plr.Character:FindFirstChild("Humanoid") and plr.Character.Humanoid.Health <= 0 or plr and plr.Character and plr.Character:FindFirstChild("being teleported") then repeat wait(.00001) until not plr or plr and config.ph.player_info[plr.Name] and not config.ph.player_info[plr.Name].isdead and plr.Character and plr.Character:FindFirstChild("Humanoid") and plr.Character.Humanoid.Health > 0 and not plr.Character:FindFirstChild("being teleported") end
			if plr and config.ph.player_info[plr.Name] and not config.ph.player_info[plr.Name].isdead and plr.Character and plr.Character:FindFirstChild("Humanoid") and plr.Character.Humanoid.Health > 0 and not plr.Character:FindFirstChild("being teleported") and config.ph.player_info[plr.Name].game_data.alive then
				game:GetService("RunService").Heartbeat:Wait()
				warn("TELEPORTED - "..plr.Name)
				--mabey add a loop to tp until there tped
				local sp = nil
				if spawns[i] then
					sp = spawns[i]
				else
					sp = spawns[math.random(1, #spawns)]
				end
				repeat
					plr.Character.HumanoidRootPart.CFrame = sp.CFrame + Vector3.new(0, 3.5, 0)
				until plr.Character.HumanoidRootPart.CFrame == sp.CFrame + Vector3.new(0, 3.5, 0)
				plr.PlayerGui.Teleport:Play()
			else
				print("skjdioajdiwjaoidjioawjdiwaiodjioajdojad")
				local suc, er = pcall(function()
					print(plr.Name)
					print(config.ph.player_info[plr.Name].isdead)
					print(plr.Character.Humanoid.Health)
					print(config.ph.player_info[plr.Name].game_data.alive)
				end)
				if not suc then error(er) end
			end
		end)
	end

the else, that prints print(“skjdioajdiwjaoidjioawjdiwaiodjioajdojad”) has never ran not a single time, it always prints teleported player, i even added a loop to make it tp u untill ur at that position and still STILL , FREAKING STILL IT DOESNT TP U SOMETIMES LIKE WHAT

Are you trying to TP someone to a part?

yes
i am,skdaksdkasjdksadklsakldjsakldklasjdkad

I remember asking ChatGPT for one because I don’t script and there were only 2 scripts I needed so I didn’t hire anyone but ask ChatGPT for this one script you might even learn how ChatGPT did it