Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Instruction:
- # This script is used to change visibility of BlockSets in game dependent of race time.
- #
- # This script should be used in Update mode.
- # BlockSets are blocks with the same name of dynamic block.
- # To use this on block you have to name your dynamic blocks "a", "b" and "c" (or change name in this script).
- # 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/
- # Time of the cycle, whole time to show all bllocks
- # You can only change this value to change cycle duration, however I encourage you to experiment ;)
- var int cycleTime = 5000; #Time in milliseconds [ms]
- # Main part of the script
- var int first = cycleTime;
- first /= 3;
- var int second = first;
- second *= 2;
- var object BlocksA;
- BlocksA = Challenge::GetBlocks("a");
- var object BlocksB;
- BlocksB = Challenge::GetBlocks("b");
- var object BlocksC;
- BlocksC = Challenge::GetBlocks("c");
- var int time;
- time = Math::Abs(time);
- time = Player::GetRaceTime();
- time %= cycleTime;
- Console::Log(time);
- if (time < first){
- BlockSet::Show(BlocksA);
- BlockSet::Hide(BlocksB);
- BlockSet::Hide(BlocksC);
- return;
- }
- if (time > second){
- BlockSet::Hide(BlocksA);
- BlockSet::Show(BlocksB);
- BlockSet::Hide(BlocksC);
- return;
- }
- BlockSet::Hide(BlocksA);
- BlockSet::Hide(BlocksB);
- BlockSet::Show(BlocksC);
- return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement