-- Zone Control: one hill, where the first player to spawn stands, and a -- shotgun beside it. Alone in the hill you glow, move faster and score -- `points_per_second` points for every second you hold it; with company -- in it, nobody scores, and dying loses the second you were holding. The -- first to 30 points wins one ten-minute round. --[=[ mode name = "Zone Control" [rules] score_to_win = 30 kill_points = 0 death_points = 0 suicide_points = 0 betrayal_points = 0 [options] "rounds.teams" = 0 "rounds.limit" = 1 "rounds.minutes" = 10 [logic.options] points_per_second = { value = 1, min = 1, max = 10 } [logic.objects.hill] source = { kind = "zone" } label = "objective" shape = { kind = "sphere", radius = 8.0 } [[logic.megalo_traits]] aura = 4 speed = 7 ]=] alias points = script_option[0] alias placed = global.number[0] alias inside = global.number[1] -- How long a player has held the hill alone, towards their next points: -- it always runs, and starts over whenever they are not alone in it. alias held = player.timer[0] alias x = temporaries.number[0] alias y = temporaries.number[1] alias z = temporaries.number[2] alias distance = temporaries.number[3] alias supply = temporaries.object[0] -- Where the shotgun goes from the first player: two Forge units along the -- x axis and one up, in tenths. alias supply_x = global.number[2] alias supply_z = global.number[3] declare supply_x = 20 declare supply_z = 10 -- The hill goes where the first player to spawn stands, the shotgun -- beside them. if placed == 0 then for each player do if placed == 0 and current_player.is_not_respawning() then placed = 1 x = current_player.biped.get_x() y = current_player.biped.get_y() z = current_player.biped.get_z() for each object with label "objective" do current_object.set_position(x, y, z) end supply = current_player.biped.place_at_me(shotgun, "supply", none, 0, 0, 0, none) x += supply_x z += supply_z supply.set_position(x, y, z) end end end for each object with label "objective" do inside = 0 for each player do if current_player.is_not_respawning() and current_object.shape_contains(current_player.biped) then inside += 1 end end for each player do current_player.held.set_rate(100%) if current_player.is_not_respawning() then distance = current_object.get_distance_to(current_player.biped) script_widget[0].set_text_for(current_player, "Hill distance: %n ft", distance) if inside == 1 and current_object.shape_contains(current_player.biped) then current_player.apply_traits(script_traits[0]) if current_player.held >= 1 then current_player.score += points current_player.held -= 1 end script_widget[1].set_text_for(current_player, "Controlling hill") script_widget[1].set_meter_for(current_player, number, current_player.held, 1) alt current_player.held = 0 script_widget[1].set_text_for(current_player, "Enter the hill alone to score") script_widget[1].set_meter_for(current_player, none, 0, 0) end alt current_player.held = 0 script_widget[0].set_text_for(current_player, "Respawn to contest the hill") script_widget[1].set_text_for(current_player, "") script_widget[1].set_meter_for(current_player, none, 0, 0) end end end script_widget[0].set_visibility(all_players, true) script_widget[1].set_visibility(all_players, true)