My goodness! The thread was already suffering a level 2 hypothermia. Warming up. This is what needs to be done:
Oh sorry, i forgot to mention something else you have to change. :S
Instead of using the function on the projectile, you should now use the function on the itemImage.
Like this,
registerInputEvent(fxDTSBrick,onKeycardHit,"Self fxDTSBrick" TAB "Player Player" TAB "Client GameConnection" TAB "Minigame Minigame");
function keyCardImage::onHitObject(%this,%obj,%slot,%col,%pos,%normal,%shotVec,%crit)
{
parent::onHitObject(%this,%obj,%slot,%col,%pos,%normal,%shotVec,%crit);
if(%col.getClassName() $= "fxDTSBrick")
{
$InputTarget_["Self"] = %col;
$InputTarget_["Player"] = %obj.client.player;
$InputTarget_["Client"] = %obj.client;
if($Server::LAN)
{
$InputTarget_["MiniGame"] = getMiniGameFromObject(%obj.client);
}
else
{
if(getMiniGameFromObject(%col) == getMiniGameFromObject(%obj.client))
{
$InputTarget_["MiniGame"] = getMiniGameFromObject(%col);
}
else
{
$InputTarget_["MiniGame"] = 0;
}
}
%col.processInputEvent(onKeycardHit,%obj.client);
}
}
Perfect. Works like a charm... with the default card. How do I make it work with multiple images? Since all the colored cards have their own image. (greenCard, blueCard etc.)