void main()
{
    object oGM = GetPCSpeaker();
    object oArea = GetArea(oGM);
    object oTrap = GetFirstObjectInArea(oArea);
    object oValidTrap = OBJECT_INVALID;

    // Loop through all objects in the same area as the PC
    while (GetIsObjectValid(oTrap))
    {
        // Check if the object is a placeable and has the correct tag
        if (GetObjectType(oTrap) == OBJECT_TYPE_PLACEABLE &&
            GetTag(oTrap) == "CAS_PLC_VFXTRAP")
        {
            oValidTrap = oTrap;
            break; // Stop at the first valid trap
        }

        oTrap = GetNextObjectInArea(oArea); // Get the next object in the area
    }

    // If no valid trap was found, notify the player
    if (!GetIsObjectValid(oValidTrap))
    {
        SendMessageToPC(oGM, "No hazard found in this area.");
        return;
    }

    // Fetch data from the found trap
    int nDC = GetLocalInt(oValidTrap, "nDC");
    string sDamage = GetLocalString(oValidTrap, "sDamage");
    int nDamageType = GetLocalInt(oValidTrap, "nDamageType");
    float fFrequency = GetLocalFloat(oValidTrap, "fFrequency");

    string sMessage = "Current Hazard Settings:\n" +
                      "DC: " + IntToString(nDC) + "\n" +
                      "Damage: " + sDamage + "\n" +
                      "Damage Type: " + IntToString(nDamageType) + "\n" +
                      "Rate: Every " + FloatToString(fFrequency) + " seconds.";

    SendMessageToPC(oGM, sMessage);
}
