Here it is with the trap set as undetectable:
// "trap1" = trap Tag
// "flame_waypoint = waypoint Tag
// "flamelarge001" = resref of placable
void main()
{
object oPC = GetLastDamager();
if (!GetIsPC(oPC)) return;
object oTrapObject = GetObjectByTag("trap1");
object oArea = GetArea(OBJECT_SELF);
object oDetector;
object oChecker = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oChecker))
{//determine which pc in this area detected the trap
if(GetIsPC(oChecker))
{
if(GetTrapDetectedBy(oTrapObject, oChecker))
{
oDetector = oChecker;
}
}
oChecker = GetNextObjectInArea(oArea);
}
SetTrapDetectedBy(oTrapObject, oDetector, FALSE);
SetTrapActive(oTrapObject, FALSE);
SetTrapDetectable(oTrapObject, FALSE);
int iActiveFlame = GetLocalInt(OBJECT_SELF, "MY_FLAME");
if (iActiveFlame != TRUE)
{
object oWP = GetWaypointByTag("flame_waypoint");
location lWP = GetLocation(oWP);
CreateObject(OBJECT_TYPE_PLACEABLE, "flamelarge001", lWP);
SetLocalInt(OBJECT_SELF, "MY_FLAME", TRUE);
}
PlaySound("as_cv_gongring1");
}