If my thinking cap is working this morning (only 4 hours of sleep) then something like this should work, as Baaleos suggested:
void main()
{
object oPC = GetItemActivator();
//plug in the tag of waypoint to teleport to
object oWP = GetWaypointByTag("TAG OF WAYPOINT HERE");
location lTarg = GetItemActivatedTargetLocation();
int nNth = 1;
object oHole = GetNearestObjectToLocation(OBJECT_TYPE_PLACEABLE, lTarg, nNth);
float fDistance = GetDistanceBetweenLocations(lTarg, GetLocation(oHole));
while (fDistance <= 1.0)
{
//plug in the tag of the vermin hole
if (GetTag(oHole) == "TAG OF HOLE HERE")
{
AssignCommand(oPC, ActionJumpToObject(oWP));
return;
}
else
{
nNth++;
oHole = GetNearestObjectToLocation(OBJECT_TYPE_PLACEABLE, lTarg, nNth);
fDistance = GetDistanceBetweenLocations(lTarg, GetLocation(oHole));
}
}
}
And don't forget with tagbased scripts to make sure that the tag of the rope is exactly the same as the name of this script.
Hope it helps.
Modifié par GhostOfGod, 12 janvier 2011 - 06:29 .