@name Gravity planet
@inputs 
@model models/hunter/misc/sphere375x375.mdl
@outputs 
@persist E:entity Ary:array G Timer Ent:entity Gconst
@trigger 

if(first()){
E=entity()
E:setMass(50000)    
G=9.103    
Gconst=(6.674*10^-0.5)
E:setMaterial("models/props_wasteland/rockgranite02a")
holoCreate(1)
holoParent(1,E)
holoPos(1,E:pos())
holoAng(1,E:toWorld(ang()))
holoScale(1,vec(16,16,16))
holoModel(1,"hqsphere2")
holoAlpha(1,100)
holoColor(1,vec(150,150,200))

holoCreate(2)
holoParent(2,E)
holoPos(2,E:pos())
holoAng(2,E:toWorld(ang()))
holoScale(2,vec(-16,-16,-16))
holoModel(2,"hqsphere2")
holoAlpha(2,100)
holoColor(2,vec(150,150,200))

runOnTick(1)    
    }
####
E:applyForce(vec(0,0,G*E:mass()))
##

Timer=Timer+1
if(Timer>60) {Timer=0}
if(Timer==10) {
  findIncludePlayerProps(owner())  
   findByClass("prop_physics")  
    Ary=findToArray()
    }

for(I=1,Ary:count()) {
Ent=Ary[I,entity]
Dir=(E:pos()-Ent:pos()):normalized()
F=(Gconst*Ent:mass()*E:mass())/((Ent:pos():distance(E:pos())^2))
Ent:applyForce(vec(0,0,G*Ent:mass())+(Dir*F))    
E:applyForce(Dir*-F)    
    }
