#onJoin // ------------------------- // | CONSTANTS | // ------------------------- set DEFAULT_MOTD -push model=humanoid,invisible -hax -tp set PRACTICE_MOTD +respawn +fly +speed set DEFAULT_ENV_SHADOW 9B9B9B // ------------------------ set current_practice_motd set current_tower set tower_color definehotkey practice|P definehotkey leave|L definehotkey restart|K // ToT = Tower of Tutorialization set Lobby_TP 32 41 44 90 0 set ToT_TP 141 10 27 45 0 set ToT_NAME Tower of Tutorialization set ToaST_NAME Tower of a Skilled Tutorial set ToT_DIFFICULTY Easy set ToT_SHADOW BBBBBB quit // Sets speedrun_time to the time and fixes its string to be MM:SS.MMM #_SpeedrunTimeFormat set speedrun_time {epochMS} setsub speedrun_time {speedrun_time_begin} set _seconds {speedrun_time} set _miliseconds {speedrun_time} setdiv _seconds 1000 setrounddown _seconds setmod _miliseconds 1000 set _minutes {_seconds} setdiv _minutes 60 setrounddown _minutes setmod _seconds 60 if _minutes|<|10 set _minutes 0{_minutes} if _seconds|<|10 set _seconds 0{_seconds} if _miliseconds|<|100 set _miliseconds 0{_miliseconds} if _miliseconds|<|10 set _miliseconds 0{_miliseconds} set speedrun_time {_minutes}:{_seconds}.{_miliseconds} quit // Sets the text color of the tower based on its difficulty. runArg1 is its difficulty #_TowerTextColor if runArg1|=|"Easy" set tower_color %a if runArg1|=|"Medium" set tower_color %e if runArg1|=|"Hard" set tower_color %o if runArg1|=|"Difficult" set tower_color %c if runArg1|=|"Challenging" set tower_color %4 if runArg1|=|"Intense" set tower_color %0 if runArg1|=|"Remorseless" set tower_color %[ if runArg1|=|"Insane" set tower_color %1 if runArg1|=|"Extreme" set tower_color %9 if runArg1|=|"Terrifying" set tower_color %r if runArg1|=|"Catastrophic" set tower_color %f quit // runArg1 is the current tower #_TowerRestart ifnot runArg1|=|"" jump #TowerEnter|{runArg1} msg %mYou must be in a tower to restart it. quit // One jump has a y boost of 1.233 // Input is measured in how many blocks to jump #JumpBoost allowmbrepeat set _boost_jump {runArg1} setmul _boost_jump 1.233 cmd boost 0 {_boost_jump} 0 0 1 0 quit #SPEED_BOOST // runArg1 is the speed multiplier // runArg2 is duration of boost, measured in seconds #SpeedBoost allowmbrepeat motd {DEFAULT_MOTD} {current_practice_motd} horspeed={runArg1} set _speedBoostTime {runArg2} if _speedCounting set _newSpeedBoost true call #_UpdateSpeedCounterUI call #_SpeedCounter quit #_SpeedCounter set _speedCounting true #_SpeedCounterLoop delay 1000 if _newSpeedBoost goto #_SpeedBoostDelete setsub _speedBoostTime 1 call #_UpdateSpeedCounterUI if _speedBoostTime|>|0 jump #_SpeedCounterLoop set _speedCounting false cpemsg bot2 motd {DEFAULT_MOTD} {current_practice_motd} quit #_UpdateSpeedCounterUI cpemsg bot2 %2Speed timer: {_speedBoostTime}s quit #_SpeedBoostDelete set _newSpeedBoost false quit quit // runArg1, runArg2, and runArg3 are x, y, z // runArg4 is yaw, runArg 5 is pitch #TeleportRepeat allowmbrepeat cmd tp {runArg1} {runArg2} {runArg3} {runArg4} {runArg5} quit // runArg1 is the abbreviation of the tower, like ToT #TowerEnter allowmbrepeat set current_practice_motd set current_tower {runArg1} call #_TowerTextColor|{{current_tower}_DIFFICULTY} cmd tp {{current_tower}_TP} setspawn {{current_tower}_TP} setdeathspawn {{current_tower}_TP} env shadow {{current_tower}_SHADOW} cpemsg bot1 {tower_color}{current_tower} cpemsg bot3 motd {DEFAULT_MOTD} set speedrun_time_begin {epochMS} quit #TowerLeave if current_tower|=|"" msg %mYou must be in a tower to leave it. if current_tower|=|"" quit cmd tp {Lobby_TP} setspawn {Lobby_TP} setdeathspawn {Lobby_TP} env shadow {DEFAULT_ENV_SHADOW} cpemsg bot1 cpemsg bot2 cpemsg bot3 quit #TowerFinish allowmbrepeat ifnot current_practice_motd|=|"" quit call #_SpeedrunTimeFormat call #TowerLeave localmsg chat {tower_color}[@nick has beaten {{current_tower}_NAME} in {speedrun_time}!] set current_tower quit #TogglePracticeMode if current_tower|=|"" msg %mYou can only enable practice mode inside a tower. if current_tower|=|"" quit // Restarts the tower ifnot current_practice_motd|=|"" jump #TowerEnter|{current_tower} set current_practice_motd {PRACTICE_MOTD} cpemsg bot3 %6PRACTICE MODE motd {DEFAULT_MOTD} {current_practice_motd} quit #input if runArg1|=|"practice" jump #TogglePracticeMode if runArg1|=|"leave" jump #TowerLeave if runArg1|=|"restart" jump #_TowerRestart|{current_tower} quit