Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. # Instruction:
  2. # This script is used to change visibility of BlockSets in game dependent of race time.
  3. #
  4. # This script should be used in Update mode.
  5. # BlockSets are blocks with the same name of dynamic block.
  6. # To use this on block you have to name your dynamic blocks "a", "b" and "c" (or change name in this script).
  7. # To name block, make sure your block is dynamically, then hold LCtrl + LShift and click on the block. Window with name entry should appear. (More complete tutorial you can find in documentation: https://docs.google.com/document/d/1NPc3UE9vzHdGh73wqbt_pFpTByCeFQFgEFyGJ88DiCs/
  8.  
  9. # Time of the cycle, whole time to show all bllocks
  10. # You can only change this value to change cycle duration, however I encourage you to experiment ;)
  11.  
  12. var int cycleTime = 5000; #Time in milliseconds [ms]
  13.  
  14.  
  15. # Main part of the script
  16. var int first = cycleTime;
  17. first /= 3;
  18. var int second = first;
  19. second *= 2;
  20.  
  21. var object BlocksA;
  22. BlocksA = Challenge::GetBlocks("a");
  23.  
  24. var object BlocksB;
  25. BlocksB = Challenge::GetBlocks("b");
  26.  
  27. var object BlocksC;
  28. BlocksC = Challenge::GetBlocks("c");
  29.  
  30. var int time;
  31. time = Math::Abs(time);
  32. time = Player::GetRaceTime();
  33. time %= cycleTime;
  34. Console::Log(time);
  35. if (time < first){
  36. BlockSet::Show(BlocksA);
  37. BlockSet::Hide(BlocksB);
  38. BlockSet::Hide(BlocksC);
  39. return;
  40. }
  41. if (time > second){
  42. BlockSet::Hide(BlocksA);
  43. BlockSet::Show(BlocksB);
  44. BlockSet::Hide(BlocksC);
  45. return;
  46. }
  47.  
  48. BlockSet::Hide(BlocksA);
  49. BlockSet::Hide(BlocksB);
  50. BlockSet::Show(BlocksC);
  51. return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement