I can't guarantee that there isn't more to the code than this, but this is how I imagine the wrench collision to be:
function WrenchProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
%client = %obj.client;
%client.wrenchbrick = %col;
messageClient(%client,<msgcallback that opens the client's wrench gui>,'');
}
Also, if you were wanting to limit wrench use, you could change it to something like this:
function WrenchProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
%client = %obj.client;
if(!%client.nowrench) // <- A property you'd have to assign to the client for wrench permissions.
{
%client.wrenchbrick = %col;
messageClient(%client,<some msgcallback that opens the client's wrench gui>,'');
}
}
That should be all there is to it.