@name PlayerDead Tele
@persist Ply:array A Dead:array B
interval(10)
A++
findByClass("player*")
findSortByDistance(entity():pos())

Find=findToArray()
if(!Find[A,entity]:isAlive()){
   B++
   Dead[B,entity]=Find[A,entity]
    if(#[Dead[B,entity]:isAlive()]# Dead[B,entity]:isValid()){
        Dead[B,entity]:teleport(entity():pos())
        B++
    }
}

if(A>Find:count()) 
    

{A=0}

