@name Bull's Personal Assistant
@model models/venompapa/wirecdlock.mdl
@persist BringTarget:entity
runOnChat(1)
runOnTick(1)
if(owner():keyPressed("G"))
{
BringTarget=owner():aimEntity()
}

Nhunna=5000000


Body=entity()
Body:propGravity(0)
Body:setMass(50000)
Body:propNotSolid(0)
#Body:propFreeze(1)
Ang = (Body:pos()-BringTarget:pos()):toAngle():yaw()

X1=BringTarget:pos():x()
Y1=BringTarget:pos():y()
Z1=BringTarget:pos():z()+5#BringTarget:radius()
Body:setAng(ang(0,Ang+-90,0))

##if(owner():lastSaid()==("Engage"))
#{
#    Body:applyForce(((vec(X1,Y1,Z1)))-((Body:pos()))*25)
#}

X3=owner():pos():x()
Y3=owner():pos():y()
Z3=owner():pos():z()
Z4=owner():toWorld(owner():forward()+110)

Height=BringTarget:height()+50
holoCreate(69)
holoPos(69,Z4)
holoScale(69,(vec(0,0,0)))
holoCreate(68)
holoPos(68,(vec(0,0,0)))
holoScale(68,(vec(0,0,0)))


rangerHitEntities(0)
RangFloorDet= rangerOffset(1000, entity():pos(), entity():up())

A = owner():lastSaid():explode(" ")
if(A[1,string]=="!Help" & chatClk(owner())){
print("Commands:")
print("Look at a Prop and hit [G] to select.")
print("Say [Grab] to pick it up.")
print("To bring it say [Bring].")
print("To make it run away say [Away].")
print("And to remove it say [BOOM]")
}

#Range1=inrange(DeterX1, DeterX2+500, DeterX2-500)
#Range2=inrange(DeterY1, DeterY2+500, DeterY2-500)
if(((Body:pos():z())<Z1))
{
    Elev=1
}
if(((Body:pos():z())>Z1))
{
    Elev=-1
}
#if((BringTarget:isValid())&&(Range1!=1)&&(Range2!=1))
#{

#}
Rang= rangerOffset(1000, entity():pos(), entity():up()*-1)
RangU= rangerOffset(1000, entity():pos(), entity():up())
if(((owner():lastSaid())=="Grab"))
{
    Grabber=1
}
else
{
    Grabber=0
}
if(BringTarget:isPlayer())
{
X9=Body:pos():x()
Y9=Body:pos():y()
Z9=Body:pos():z()-BringTarget:height()

BringTarget:teleport(vec(X9,Y9,Z9))
Body:setPos(Body:toWorld(vec(0,-3,Elev)))
}
if(BringTarget:isValid()&&(owner():lastSaid())!="Bring")
{
Body:setPos(Body:toWorld(vec(0,-3,Elev)))
}

if(BringTarget:isValid()&&(owner():lastSaid())=="Bring")
{
Body:setPos(Body:toWorld(vec(0,-2,Elev)))
}

if(((owner():lastSaid())=="Bring")&&!BringTarget:isPlayer())
{
    #Body:setPos(vec(Rang:position():x(),Rang:position():y(),Rang:position():z()+10))
    Body:weldTo(Rang:entity(),0)
    Rang:entity():propFreeze(0)
    Grabber=1
    BringTarget=holoEntity(69)
        Body:weldTo(RangU:entity(),0)
    RangU:entity():propFreeze(0)
}
elseif(((owner():lastSaid())=="Away")&&!BringTarget:isPlayer())
{
    #Body:setPos(vec(Rang:position():x(),Rang:position():y(),Rang:position():z()+10))
    Body:weldTo(Rang:entity(),0)
    Rang:entity():propFreeze(0)
        Body:weldTo(RangU:entity(),0)
    RangU:entity():propFreeze(0)
    Grabber=1
    BringTarget=holoEntity(68)
}
else
{
    Body:removeAllConstraints()
    Grabber=0
    if(owner():keyPressed("G"))
{
BringTarget=owner():aimEntity()
}
}
Pi=entity():angles():pitch()
Ya=entity():angles():yaw()
Ro=entity():angles():roll()

runOnTick(1)
holoCreate(0)
holoModel(0,"models/props_combine/combine_mine01.mdl")



holoAng(0,(ang(Pi,0+realtime()*900,Ro)))
holoScale(0,(vec(0.9,0.9,0.9)))
holoPos(0,(vec(entity():pos():x(),entity():pos():y(),entity():pos():z())))

holoCreate(1)
holoModel(1,"models/venompapa/wirecdlock.mdl")
holoScale(1,(vec(2,2,1)))
holoPos(1,(vec(entity():pos():x(),entity():pos():y(),entity():pos():z())))
holoAng(1,(ang(Pi,0+realtime()*900,Ro)))
holoMaterial(1,"models/effects/slimebubble_sheet")
holoColor(1,(vec(0,0,0)))
holoCreate(2)
holoModel(2,"models/bull/various/gyroscope.mdl")
holoAng(2,(ang(Pi,0-realtime()*900,Ro)))
holoScale(2,(vec(2,2,0.9)))
holoPos(2,(vec(entity():pos():x(),entity():pos():y(),entity():pos():z())))
holoCreate(50)
holoModel(50,"models/XQM/Rails/trackball_1.mdl")
holoPos(50,(vec(entity():pos():x(),entity():pos():y(),entity():pos():z())))

if(((owner():lastSaid())=="BOOOoM"))
{
selfDestruct()
explosion(entity():pos(),300)
}
