// Main function
void main()
{
    // Send a message to the first PC that the script has started
    SendMessageToPC(GetFirstPC(), "Script started.");

    // Get the parameters from the event
    object oItem = GetEventParamObject(0);
    object oTarget = GetEventParamObject(1);
    object oUser = GetEventParamObject(2);

    // Debugging: check if we got the correct objects
    SendMessageToPC(oUser, "oItem: " + GetName(oItem));
    SendMessageToPC(oUser, "oTarget: " + GetName(oTarget));
    SendMessageToPC(oUser, "oUser: " + GetName(oUser));

    // Get the location of the target
    location lTarget = GetLocation(oTarget);

    // Create the red beam effect
    effect eBeam = EffectBeam(VFX_BEAM_FIRE, oUser, BODY_NODE_CHEST);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBeam, lTarget);
    SendMessageToPC(oUser, "Beam effect applied.");

    // Send a message to the first PC that the script has completed
    SendMessageToPC(GetFirstPC(), "Script completed.");
}
