How to make a area(region)

so here how can i make a area(region) that if a player go to that area it will pop a top center message saying You Will Be Teleported on the Game Area in 10-0 and if it hit 0.the player that is on that area will be teleported and there is 10 map(region) rural,war,jungle,snow,lab,NoRun,NoHide,JukeOnly and Volcano. and i just said it’s random so all the player that is on that Area will be teleported on a random map (that rural,war blah blah blah that i just said) so how can i make this

2 Likes

So you want every player in the region to be teleported to the same map when one’s timer reaches 0?

2 Likes

Make a player attribute, and set the default value as 10.
Then make this script (repeat it for all regions)

every second
for all units in (all units in (region 1)
 do:
  set (timer player attribute) of (owner of (selected unit)) as (timer player attribute) of (owner of (selected unit)) - 1
  update overlay text (center) with (You can teleport to the selected area in (timer player attribute) seconds.
 if (timer player attribute) of (selected unit) == 0
  then do:
   move (selected unit) to (random position in (region))
4 Likes

yes i want the player in the region to be teleported in a random map like on DeathRunGame they are gonna tp on a random map

2 Likes

so i need to copy paste this script for 10 times so that there destination of the map will be random?

2 Likes

Well no, having 10 duplicates of the same script won’t make it choose a random map. Here’s a way you can select a random region (using a numeric global variable called i, and assuming all 10 map regions have the word ‘Map’ in their name):

set variable (i) as (random number between (1) and (10))
for all regions in (all regions in the game)
  do:
    if ((name of (selected region)) contains (Map)) == true
      then do:
        decrease (i) by 1
        if (i) == 0
          then do:
            for all units in (region to teleport from)
              do:
                move (selected unit) to (center of (selected region))
            break out of the loop
3 Likes

soo what is this i? string?

2 Likes

can u tell me how does this work?

2 Likes

basically if u want to do this you can do 2 scripts
Script Name : EnterRegion

trigger : [When A Unit Enters A Region]
 then do:
  if((last triggered region) == (TheRegion))
   then do:
    set (timer) of (last triggering unit) to (10)
   else do:

Script Name : RegionTriggers

trigger : [every second]
 then do:
  for all unit in (units in region (TheRegion))
   then do:
    for all players in (owner of (selected unit))
     then do:
      if((player name of (selected player)) == (player name of (owner of (selected unit))))
       then do:
        show (Top) for (selected player)
        update (Top) with (wait ((timer) of (selected unit)) until teleport)
        set (timer) of (selected unit) as (((timer) of (selected unit)) - (1))
        else do:
  for all units in (all units in game)
   then do:
    if((timer) == (0))
     then do:
      move (selected unit) to (center of (sussyteleport))
      set (timer) of (selected unit) to (10)
     else do:

now u could just add 4 regions to match the sides of that main region and add this script

trigger : [when a unit enters a region]
 then do:
  if((triggering region) == (exitReg))
   then do:
    hide (Top) for (last triggering unit)
   else do:
2 Likes

soo wdym by this.so ths script is just for the timer?

1 Like

yeah but i didn’t add when it reaches 0

2 Likes

ohhh then how it works

1 Like

it will show a overlay text that will give u a timer that will teleport when the timer reaches 0

2 Likes

ohh ok thx :slight_smile: :grinning:hehehe

2 Likes

A number variable, added in Global Variables (in Environment).

2 Likes

ok i figured it out like 10 mins later lol still thx

2 Likes

wai wha wdym by for all players in (owner of (selected unit))
and if player name of selected player im confused with that and the until teleport in update (top)

2 Likes

bruh im just noticing something disapeared from the for all players thing THIS IS SOME BS THEY TOOK AWAY THE ALL ENTITIES CONNECTED TO PLAYER THING BUT NOT THE UNITS ONE???

1 Like

wdym by the one i said ;_;

2 Likes

so how can i do it becuz they removed it lol

1 Like