Trouble In Terrorist Town (Remake)

Z6DA2

The original trouble in terrorist town for overwatch was buggy, so I made this.

Code Snippet

View variables

Rules

No Rules are declared.
variables { global: 0: SomeoneRevived 1: CanSet player: 0: Role } rule("Global Init") { event { Ongoing - Global; } actions { Disable Built-In Game Mode Scoring; Disable Built-In Game Mode Completion; Create HUD Text(All Players(All Teams), Custom String("Bad {0}", Count Of(Filtered Array(All Players(All Teams), Compare( Player Variable(Current Array Element, Role), ==, 3))), Null, Null), Null, Null, Right, 2, Red, White, White, Visible To and String, Default Visibility); Create HUD Text(All Players(All Teams), Custom String("Good {0}", Count Of(Filtered Array(All Players(All Teams), Compare( Player Variable(Current Array Element, Role), ==, 2))), Null, Null), Null, Null, Right, 1, Green, White, White, Visible To and String, Default Visibility); Create HUD Text(All Players(All Teams), Custom String("Hero {0}", Count Of(Filtered Array(All Players(All Teams), Compare( Player Variable(Current Array Element, Role), ==, 1))), Null, Null), Null, Null, Right, 0, Blue, White, White, Visible To and String, Default Visibility); } } rule("Player Init") { event { Ongoing - Each Player; All; All; } actions { Disable Built-In Game Mode Respawning(Event Player); Create HUD Text(Filtered Array(Event Player, Compare(Player Variable(Event Player, Role), ==, 1)), Custom String("Hero", Null, Null, Null), Null, Null, Left, 0, Sky Blue, White, White, Visible To and String, Default Visibility); Create HUD Text(Filtered Array(Event Player, Compare(Player Variable(Event Player, Role), ==, 3)), Custom String("Bad", Null, Null, Null), Null, Null, Left, 0, Red, White, White, Visible To and String, Default Visibility); Create HUD Text(Filtered Array(Event Player, Compare(Player Variable(Event Player, Role), ==, 2)), Custom String("Good", Null, Null, Null), Null, Null, Left, 0, Green, White, White, Visible To and String, Default Visibility); Create HUD Text(Filtered Array(Event Player, Compare(Player Variable(Event Player, Role), !=, 1)), Custom String("Hero {0}", First Of(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Role), ==, 1))), Null, Null), Null, Null, Left, 1, Blue, White, White, Visible To and String, Default Visibility); disabled Set Ability 2 Enabled(Event Player, False); Create Icon(Filtered Array(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Role), ==, 3)), Compare(Player Variable(Event Player, Role), ==, 3)), Event Player, Skull, Visible To and Position, Red, True); Disable Death Spectate All Players(Event Player); Create In-World Text(Filtered Array(All Players(All Teams), Compare(Player Variable(Event Player, Role), ==, 1)), Custom String( "Hero", Null, Null, Null), Event Player, 1, Clip Against Surfaces, Visible To Position and String, Sky Blue, Default Visibility); Set Respawn Max Time(Event Player, 9999); Create HUD Text(Filtered Array(Event Player, Compare(Player Variable(Event Player, Role), ==, 1)), Custom String("Revives {0}", Multiply(Not(Global Variable(SomeoneRevived)), 1), Null, Null), Null, Null, Left, 1, Blue, White, White, Visible To and String, Default Visibility); } } rule("Start") { event { Ongoing - Global; } conditions { Is Game In Progress == True; } actions { Set Player Variable(Array Slice(Randomized Array(All Players(All Teams)), 0, Round To Integer(Divide(Count Of(All Players( All Teams)), 4), To Nearest)), Role, 3); Set Player Variable(Array Slice(Randomized Array(Filtered Array(All Players(All Teams), Compare(Player Variable( Current Array Element, Role), !=, 3))), 0, Count Of(All Players(All Teams))), Role, 2); Set Player Variable(Random Value In Array(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Role), !=, 3))), Role, 1); } } rule("Died") { event { Ongoing - Each Player; All; All; } conditions { Health(Event Player) == 1; } actions { Set Status(Event Player, Null, Knocked Down, 9999); } } rule("Allow Flash") { event { Ongoing - Each Player; All; All; } conditions { Player Variable(Event Player, Role) == 1; } actions { Set Ability 2 Enabled(Event Player, True); Set Max Health(Event Player, 125); } } rule("Disable Flash") { event { Ongoing - Each Player; All; All; } conditions { Player Variable(Event Player, Role) != 1; } actions { Set Ability 2 Enabled(Event Player, False); Set Max Health(Event Player, 100); } } rule("Evil Win") { event { Ongoing - Global; } conditions { Count Of(Filtered Array(Filtered Array(All Living Players(All Teams), Compare(Has Status(Current Array Element, Knocked Down), ==, False)), Compare(Player Variable(Current Array Element, Role), <, 3))) == 0; Is Game In Progress == True; } actions { Wait(1, Abort When False); Modify Player Score(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Role), ==, 3)), 1); Big Message(All Players(All Teams), Custom String("Bad Guys Win", Null, Null, Null)); Respawn(All Players(All Teams)); Set Player Variable(All Players(All Teams), Role, 0); Set Player Variable(Array Slice(Randomized Array(All Players(All Teams)), 0, Round To Integer(Divide(Count Of(All Players( All Teams)), 4), Down)), Role, 3); Set Player Variable(Array Slice(Randomized Array(Filtered Array(All Players(All Teams), Compare(Player Variable( Current Array Element, Role), !=, 3))), 0, Count Of(All Players(All Teams))), Role, 2); Set Player Variable(Random Value In Array(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Role), !=, 3))), Role, 1); Set Global Variable(SomeoneRevived, 0); Set Global Variable(CanSet, 0); } } rule("Good Win") { event { Ongoing - Global; } conditions { Count Of(Filtered Array(Filtered Array(All Living Players(All Teams), Compare(Has Status(Current Array Element, Knocked Down), ==, False)), Compare(Player Variable(Current Array Element, Role), ==, 3))) == 0; Is Game In Progress == True; } actions { Wait(1, Abort When False); Modify Player Score(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Role), <, 3)), 1); Big Message(All Players(All Teams), Custom String("Good Guys Win", Null, Null, Null)); Respawn(All Players(All Teams)); Set Player Variable(All Players(All Teams), Role, 0); Set Player Variable(Array Slice(Randomized Array(All Players(All Teams)), 0, Round To Integer(Divide(Count Of(All Players( All Teams)), 4), Up)), Role, 3); Set Player Variable(Array Slice(Randomized Array(Filtered Array(All Players(All Teams), Compare(Player Variable( Current Array Element, Role), !=, 3))), 0, Count Of(All Players(All Teams))), Role, 2); Set Player Variable(Random Value In Array(Filtered Array(All Players(All Teams), Compare(Player Variable(Current Array Element, Role), !=, 3))), Role, 1); Set Global Variable(SomeoneRevived, 0); Set Global Variable(CanSet, 0); } } rule("Unkillable") { event { Ongoing - Each Player; All; All; } conditions { Is Alive(Event Player) == True; } actions { Set Status(Event Player, Null, Unkillable, 9999); Heal(Event Player, Null, 99999); } } rule("Revive Heal") { event { Ongoing - Each Player; All; All; } conditions { Has Status(Event Player, Knocked Down) == False; } actions { Heal(Event Player, Null, 9999); } } rule("Revive") { event { Ongoing - Each Player; All; All; } conditions { Player Variable(Event Player, Role) == 1; Is Using Ability 2(Event Player) == True; Has Status(Ray Cast Hit Player(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(Facing Direction Of( Event Player), 4)), All Players(All Teams), Event Player, True), Knocked Down) == True; Global Variable(SomeoneRevived) != True; } actions { Clear Status(Filtered Array(First Of(Sorted Array(Filtered Array(All Players(All Teams), Compare(Has Status(Current Array Element, Knocked Down), ==, True)), Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(Event Player), Add( Eye Position(Event Player), Multiply(Facing Direction Of(Event Player), 4)), All Players(All Teams), Event Player, True)))), Compare(Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position( Event Player), Multiply(Facing Direction Of(Event Player), 4)), All Players(All Teams), Event Player, True)), <=, 3)), Knocked Down); Set Global Variable(SomeoneRevived, True); } } rule("Checking") { event { Ongoing - Each Player; All; All; } conditions { Player Variable(Event Player, Role) == 1; Has Status(Ray Cast Hit Player(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(Facing Direction Of( Event Player), 4)), All Players(All Teams), Event Player, True), Knocked Down) == True; Is Button Held(Event Player, Interact) == True; } actions { Small Message(Event Player, Custom String("3", Null, Null, Null)); Wait(1, Abort When False); Small Message(Event Player, Custom String("2", Null, Null, Null)); Wait(1, Abort When False); Small Message(Event Player, Custom String("1", Null, Null, Null)); Wait(1, Abort When False); If(Compare(Player Variable(Ray Cast Hit Player(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply( Facing Direction Of(Event Player), 4)), All Players(All Teams), Event Player, True), Role), ==, 2)); Small Message(Event Player, Custom String("Innocent", Null, Null, Null)); Else; Small Message(Event Player, Custom String("Bad", Null, Null, Null)); End; } } rule("Join") { event { Player Joined Match; All; All; } conditions { Match Time < 550; } actions { Set Status(Event Player, Null, Knocked Down, 9999); } }
View Fullscreen
Copy current Rule
Copy all Rules
Categories | Free for all
Tags | ttt
Heroes | McCree
Maps | All
Created at |
Last updated |
Current version | 2.0.0

Update Log

1.0.0
TN5CX

0 Comments

Log in or Sign up to place a comment.
Workshop.codes - Background image