Darksaber2213

plantBrick.cs [MODULE]

Jan 1st, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1. function createBrick(%client, %pos, %data, %angleID, %baseplate, %color, %colorFX, %shapeFX, %isRaycasting, %isColliding, %isRendering)
  2. {
  3.     %brick = new fxDTSBrick()
  4.     {
  5.         client = %client;
  6.         position = %pos;
  7.         datablock = %data;
  8.         angleID = %angleID;
  9.         rotation = rotationFromAngleID(%angleID);
  10.         isBaseplate = %baseplate;
  11.         colorID = %color;
  12.         colorFX = %colorFX;
  13.         shapeFX = %shapeFX;
  14.         isRendering = %isRendering;
  15.         isColliding = %isColliding;
  16.         isRaycasting = %isRaycasting;
  17.         isPlanted = 1;
  18.     };
  19.    
  20.     %error = %brick.plant();
  21.    
  22.     if(%error == 1 || %error == 5 || %error == 3)
  23.     {
  24.         %brick.delete();
  25.         return;
  26.     }
  27.  
  28.     %brick.setTrusted(1);
  29.     BrickGroup_888888.add(%brick);
  30.  
  31.     %brick.setRendering(%brick.isRendering);
  32.     %brick.setRayCasting(%brick.isRaycasting);
  33.     %brick.setColliding(%brick.isColliding);
  34.     %brick.setColorFX(%brick.colorFX);
  35.  
  36.     return %brick;
  37. }
  38.  
  39. function rotationFromAngleID(%angle)
  40. {
  41.     switch(%angle)
  42.     {
  43.         case 0:
  44.             %rotation = "1 0 0 0";
  45.         case 1:
  46.             %rotation = "0 0 1 90";
  47.         case 2:
  48.             %rotation = "0 0 1 180";
  49.         default:
  50.             %rotation = "0 0 -1 90";
  51.     }
  52.     return %rotation;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment