@name Player Respawn Locator
@inputs 
@outputs DH V:vector C Count Heal1 Heal2 D
@persist P:array LastNumPlayer C H:array H1:array
interval(100)
if (first()) {
H = array()
H1 = array()
C=1
entity():setAlpha(0)
D=0}
if (numPlayers()!=LastNumPlayer) {
findInSphere(vec(0,0,0),1000000)
findClipToClass("player")
P = findToArray()
}
LastNumPlayer=numPlayers()
E = P:entity(C)
Count = P:count()
Max = 500
Min = 0
D=random(0,360)
R=random(0,500)
V = entity():pos()+vec(R*cos(D),R*sin(D),100)
H:setNumber(C,E:health())
Heal1 = H:number(C)
Heal2 = H1:number(C)
DH = Heal1-Heal2
timer("Delay",1000)

if ((DH)>=100) {E:setPos(V) 
print("Respawning")}

if (C>Count) {C=1} else {C+=1}
if (clk("Delay")) {H1 = H:clone()}
