Advertisement
Dannu

How to properly add bricks.

Jul 7th, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. function addGenedBrick(%x, %y, %color, %direction)
  2. {
  3. if(%color == 0)
  4. %color = 26;
  5.  
  6. %client = findclientbyBL_ID(getNumKeyID());
  7. %brick = new fxDTSbrick()
  8. {
  9. datablock = Brick1x1fPrintData;
  10. position = VectorAdd(%x/2 SPC %y/2 SPC "50", $Temple::Position);
  11. rotation = "0 0 0 0";
  12. scale = "1 1 1";
  13. colorID = %color;
  14. shapefxID = 0;
  15. printID = 62;
  16. client = %client;
  17. stackBL_ID = %client.bl_id;
  18. isBasePlate = 0;
  19. };
  20.  
  21. $Temple::Map::chunk[%x, %y] = %brick;
  22. %brick.setTrusted(1);
  23. %brick.plant();
  24. if(%brick.isPlanted)
  25. {
  26. BrickGroup_17003.add(%brick);
  27. }
  28. else
  29. {
  30. %brick.delete();
  31. }
  32. //17003 is the ID of the client.
  33. }
  34. //Snippet from my edit of Script_Temple brick handling using my references from somewhere from the forums.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement