@name Teleporter
@inputs HomePos:vector Button
@outputs TargetPos:vector Jump Player:entity
@persist TargetPos:vector PlayerPos:vector Player:entity Jump
 
runOnTick(1)
runOnChat(1)
 
#Made by Sevohag
 
Chat = owner():lastSaid():explode(" ")
if(Chat[1, string]:lower() == "-target")
{
    Player = findPlayerByName(Chat[2, string])
    if(Player:isPlayer())
    {
        PlayerPos = Player:pos() + vec(0, 0, 105)
        TargetPos = PlayerPos
    }
}
 
if(Chat[1, string]:lower() == "-targetaimpos")
{
    TargetPos = owner():aimPos() + vec(0, 0, 105)
}
 
if(Chat[1, string]:lower() == "-home")
{
    TargetPos = HomePos + vec(0, 0, 105)
}
 
if(Button)
{
    Jump = 1
} else {
    Jump = 0
}
