@name Guess What? MELON RACER!!!!!!!!!!!!
@inputs [Cam Pod]:wirelink
@outputs 
@persist Ent:entity
@trigger 

interval(10)

StartPoint = entity():pos() + vec(0,0,100)#vec(0,0,-9600)
SinkForce = 50
MoveForce = 500
UnderWaterMoveForce = 250
UnderWaterJumpForce = 250
JumpForce = 1000
JumpUnderGroundFactor = 20

if(!Ent & Pod["Active",number])
{
    Ent = propSpawn("models/props_junk/watermelon01.mdl",StartPoint,0)
}

Cam["Activated",number] = Pod["Active",number]
Cam["Direction",vector] = Pod["Entity",entity]:driver():eye()
Cam["Position",vector] = Ent:pos() + -Pod["Entity",entity]:driver():eye() * 100

rangerFilter(Ent)
Distance = rangerOffset(JumpUnderGroundFactor,Ent:pos(),vec(0,0,-1)):distance()

if(Ent:isUnderWater() & !Pod["W",number] & !Pod["S",number] & !Pod["Space",number])
{
    Ent:applyForce(vec(0,0,-SinkForce))
}

if(Pod["W",number])
{
    if(Ent:isUnderWater())
    {
        Ent:applyForce(Pod["Entity",entity]:driver():eye() * UnderWaterMoveForce)
    }
    else
    {
        Ent:applyForce(Pod["Entity",entity]:driver():eye():setZ(0) * MoveForce)
    }
}

if(Pod["S",number])
{
    if(Ent:isUnderWater())
    {
        Ent:applyForce(Pod["Entity",entity]:driver():eye() * -UnderWaterMoveForce)
    }
    else
    {
        Ent:applyForce(Pod["Entity",entity]:driver():eye():setZ(0) * -MoveForce)
    }
}

if(Pod["Space",number])
{
    if(Ent:isUnderWater())
    {
        Ent:applyForce(vec(0,0,UnderWaterJumpForce))
    }
    elseif(Distance < 11)
    {
        Ent:applyForce(vec(0,0,JumpForce))
    }
}

if(Pod["Mouse1",number])
{
    Ent:propFreeze(1)
}
else
{
    Ent:propFreeze(0)
}
