Create
Return to post

Comparing difference between and

View raw
  • variables
  • {
  • global:
  • 0: Timer
  • 1: Interval
  • 2: Player1
  • 3: Player2
  • 4: PositionPlayer1
  • 5: PositionPlayer2
  • 6: FacingPlayer1
  • 7: FacingPlayer2
  • }
  • disabled rule("Spawn bots - For debugging")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Crouch) == True;
  • Is Button Held(Event Player, Interact) == True;
  • }
  • actions
  • {
  • Create Dummy Bot(Random Value In Array(All Heroes), Opposite Team Of(Team Of(Event Player)), -1.000, Add(Event Player, Multiply(
  • Facing Direction Of(Event Player), 0.500)), Facing Direction Of(Event Player));
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Set Global Variable(Interval, 10);
  • Set Global Variable(Timer, Global Variable(Interval));
  • }
  • }
  • rule("Timer")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global Variable(Timer) == Global Variable(Interval);
  • }
  • actions
  • {
  • Chase Global Variable At Rate(Timer, 0, 1, Destination and Rate);
  • }
  • }
  • rule("Swap 2 random players")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global Variable(Timer) <= 0;
  • }
  • actions
  • {
  • Set Global Variable(Player1, Random Value In Array(All Players(All Teams)));
  • Set Global Variable(Player2, Random Value In Array(Remove From Array(All Players(All Teams), Global Variable(Player1))));
  • Set Global Variable(PositionPlayer1, Position Of(Global Variable(Player1)));
  • Set Global Variable(PositionPlayer2, Position Of(Global Variable(Player2)));
  • Set Global Variable(FacingPlayer1, Facing Direction Of(Global Variable(Player1)));
  • Set Global Variable(FacingPlayer2, Facing Direction Of(Global Variable(Player2)));
  • Skip If(Or(Compare(Global Variable(PositionPlayer1), ==, 0), Compare(Global Variable(PositionPlayer2), ==, 0)), 11);
  • Big Message(All Players(All Teams), Custom String("Swap!", Null, Null, Null));
  • Teleport(Global Variable(Player1), Global Variable(PositionPlayer2));
  • Set Facing(Global Variable(Player1), Global Variable(FacingPlayer2), To World);
  • Teleport(Global Variable(Player2), Global Variable(PositionPlayer1));
  • Set Facing(Global Variable(Player2), Global Variable(FacingPlayer1), To World);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Yellow, Global Variable(Player1), 1);
  • Play Effect(All Players(All Teams), Ring Explosion, Yellow, Global Variable(Player1), 2);
  • Play Effect(All Players(All Teams), Buff Explosion Sound, Yellow, Global Variable(Player1), 50);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Yellow, Global Variable(Player2), 1);
  • Play Effect(All Players(All Teams), Ring Explosion, Yellow, Global Variable(Player2), 2);
  • Play Effect(All Players(All Teams), Buff Explosion Sound, Yellow, Global Variable(Player2), 50);
  • Set Global Variable(Timer, Global Variable(Interval));
  • }
  • }
Join the Workshop.codes Discord