@name Holo Teleporter Network
@inputs EmitterI:wirelink EmitterP:wirelink
@outputs On Data:table Pl:array Pl1:array C Local:array 
@outputs XYZ:vector XYZI:vector PL DATA
@persist Data:table Pl:array C Pl1:array Local:array On 
@trigger all
Time=20
interval(Time)
#Find the players
timer("scan",1000)
if(clk("scan")){
findInSphere(vec(0,0,0),1000000)
findIncludeClass("player")
Pl=findToArray()
}#End of find the players

#Typical Chat finding stuff
Owner=entity():owner()
Chat = Owner:lastSaid()
K=curtime()-Owner:lastSaidWhen()<(Time*2)/1000
PL=Pl:count()
DATA=Data:count()
#String table Items
List="list"
Set="set"
Command="WZ"
Active="on"
InActive="off"
P1 = "1"
P2 = "2"
P3 = "3"
P4 = "4"
P5 = "5"
P6 = "6"
P7 = "7"
P8 = "8"
P9 = "9"
P10 = "0"
Playrs="players"

#Find string table items in Chat
Com=Chat:find(Command)
Sett=Chat:find(Set)
C1 = Chat:find(P1)
C2 = Chat:find(P2)
C3 = Chat:find(P3)
C4 = Chat:find(P4)
C5 = Chat:find(P5)
C6 = Chat:find(P6)
C7 = Chat:find(P7)
C8 = Chat:find(P8)
C9 = Chat:find(P9)
C10 = Chat:find(P10)
Act=Chat:find(Active)
InAct=Chat:find(InActive)
L=Chat:find(List)
Play=Chat:find(Playrs)
#Chat Command functions
Map=map()
if(Com&K){
if(Act){On=1}
if(InAct){On=0}
if(Play){print(Pl:concat("<>"))}
if(L){print(XYZ:toString())}

#teleport location seting functions
if(Sett){
if(C1){Data:setVector(Map+P1,Owner:pos())}
if(C2){Data:setVector(Map+P2,Owner:pos())}
if(C3){Data:setVector(Map+P3,Owner:pos())}
if(C4){Data:setVector(Map+P4,Owner:pos())}
if(C5){Data:setVector(Map+P5,Owner:pos())}
if(C6){Data:setVector(Map+P6,Owner:pos())}
if(C7){Data:setVector(Map+P7,Owner:pos())}
if(C8){Data:setVector(Map+P8,Owner:pos())}
if(C9){Data:setVector(Map+P9,Owner:pos())}
if(C10){Data:setVector(Map+P10,Owner:pos())}
}#end Sett
}#end Com&K

Max=10
Box=50
if(C<Max){C++}else{C=1}

if(Data:vector(Map+C)){
findClipToRegion(Data:vector(Map+C)+vec(Box,Box,Box),
Data:vector(Map+C)+vec(-Box,-Box,-Box))
Pl1=findToArray()
if(Pl1:count()){On=1}else{On=0}
#Saves a local map of used teleporter locations
Local:setVector(C,Data:vector(Map+C))

XYZ=Data:vector(Map+C)
EmitterP:setVector("Vector", XYZ)
EmitterP:setNumber("Active", 1)
}else {EmitterP:setNumber("Active", 0)}
EmitterP:setNumber("FadeRate",255)



XYZI=Data:vector(Map+C)
#Holographic Interface Code
Dif = XYZI-owner():pos()-vec(0,0,64)
Dif = Dif/Dif:length()
Vec = owner():pos()+vec(0,0,64) + Dif*100

if (On==1) {
    XYZC=EmitterI:vector("Pressed Vector")
    EmitterI:setVector("Vector", Vec)
    EmitterI:setNumber("Active", 1)
} else {EmitterI:setNumber("Active", 0)}
EmitterI:setNumber("FadeRate",255)
#End of Holographic Interface Code

