I'm trying to create a grappling hook for my physic player (a ball) and I'm stuck..

Code:
 
//Customize tags

//Section: Controls
//Entry: Move Right Key Code
Var Move_Right=77;
//Entry: Move Left Key Code
Var Move_Left=75;
//Entry: Shoot Spike Key Code
Var Shoot_Spike=29;
//End-----------

action actplayer
{
var hingeID;
phent_settype(my, ph_rigid, ph_sphere);
phent_setmass(my, 1, ph_sphere);
phent_setelasticity(my, 61, 0);
phent_setfriction (my, 6);
my.skill1=my.y;
my.skill2=my.pan;
my.skill3=my.roll;
my.skill4=my.tilt;

while(1)
{
my.y=my.skill1;
my.pan=my.skill2;
my.roll=my.skill3;
my.tilt=my.skill4;

if(key_pressed(Move_Left))
{
phent_addforcelocal(my,vector(-50,0,0),nullvector);
}

if(key_pressed(Move_Right))
{
phent_addforcelocal(my,vector(50,0,0),nullvector);
}

if(key_pressed(Shoot_Spike))
{
var axis[3]=1,0,1;
var anchor[3];
//Get ceiling height
temp=trace(my.x,vector(my.x,my.y,my.z+10));
vec_set(anchor,target.x);
//--------------------
hingeID=phcon_add(PH_HINGE,my,0);
phcon_setparams1(hingeID,anchor,axis,nullvector);
}

wait(1);
}
}



This is for my gameinaday entry so I need help soon... The player will move correcty until I try to use the "grappling hook" ability.. any ideas?

A6 Com 6.30.0