# Start new rays after trigger?

I am making somewhat of an FPS, I am making where no bullets come out of the barrel, but a ray comes out. I know how to make a ray with distance and detect a property, but that's not the problem. I am making a penetration system where the ray goes through objects with a certain property ("penetrable"). I can do this, but the way I want this to work is the following: as soon as the ray (first ray) hits a penetrable object, a new ray is created. Also, when the ray hits the property, it casually would send a message ("x") to tell the other player to lose health. If the ray is a ray that is new (penetrated through an object) one, I need it to send the other player a message "xy". This would make it possible to have the bullets deal less damage through walls, and make it possible to reward you differently. So what am I asking for? I would like to have a ray come out of the barrel (if it hits someone before it penetrated, it sends the regular "lose x hp message."), and if it hits a property "penetrable," a new ray would be created that sends players the message "lose x-y" if it hits. I know this sounds very hard, but I can already make it very far; I am just not sure if I am doing this right. Any help is appreciated, thanks!

if ( hit_penetrable and Xray_hit_player ) : send(XY)