I'm going to offer my take on the event system Nicepoint suggested earlier. I propose calling these "node-scripts" (in contrast to proper scripts, which would be written in an embedded language like Ruby or Lua):
This will kill the player who activates the node-script. How does it work? Well, here's what it looks like when you show the "settings" for each node:
The
Activation node is a
detector node to the script. When a player clicks on the brick, it will cause all
Activation nodes on that brick's node-scripts to output data of type
Event.
Event basically just holds data referring back to whatever caused the
Event - in this case, it would hold a reference to a
Entity (such as a player!), a
Client, and a
Brick (which in most cases will simply be the brick the node-script is being run on, and thus is redundant; however, there may be situations where you're running the node-script from somewhere else). When viewing the settings dialog for
Activate, it only shows information about it, since there's no settings to adjust. The
Event that the node outputs is then piped into
Select, which is a
processor node.
Select takes an
Event and "extracts" the information from it; in its settings dialog, there is a drop-down box to choose which data to extract. Note that it includes various data-types that are NOT available on the event, and thus would cause an error if the node-script were run. In any case,
Entity is selected, and so the
Select node outputs an
Entity (because the output data type can vary, it has an asterisk). Finally, this is fed into the
Kill effector node, which affects the outside world. In this case, it takes in an
Entity, and kills it. It has two settings which determine its behavior, but has no outputs. (In theory, you could have it output a
Boolean with information on whether it successfully killed the input
Entity.)
I could come up with a more complex example if desired. Or just play LittleBigPlanet. Or Wiremod for Garry's Mod.
EDIT: I've sort of realized that the Event datatype and Select processor are unnecessary - the event could simply have multiple outputs, one for each possible target.
EDIT2: Icons from game-icons.net.