Skip to content

Instantly share code, notes, and snippets.

@andr3wmac
Created April 23, 2014 09:44
Show Gist options
  • Save andr3wmac/11208941 to your computer and use it in GitHub Desktop.
Save andr3wmac/11208941 to your computer and use it in GitHub Desktop.
Torque3D - ServerPlayExplosion
function ServerPlayExplosion(%position, %datablock)
{
// Play the given explosion on every client.
// The explosion will be transmitted as an event, not attached to any object.
for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
{
%client = ClientGroup.getObject(%idx);
commandToClient(%client, 'PlayExplosion', %position, %datablock.getId());
}
}
function clientCmdPlayExplosion(%position, %effectDataBlock)
{
if (isObject(%effectDataBlock))
{
new Explosion()
{
position = %position;
dataBlock = %effectDataBlock;
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment