like for example team 1 has only 1 min max to kill team 2, if they succeed, they win, if not, they lose.
There’s a Workshop Discussion category on the forum that you can move this to get help easier
my bad i’m new to this, done.
Share code: V4DHK
I went a little overboard with this code, but I hope it’s what you wanted. At the very least you can read the code and try to understand how it works. Here’s a summary:
- Used the “Elimination” game mode as a base.
- Disabled the default victory conditions so I could add the ones you wanted.
- Added “HUD Text” that tells the player they will win (or lose) in 60 seconds depending on which team they are on.
If the share code stops working, paste this into workshop:
rule("setup")
{
event
{
Ongoing - Global;
}
actions
{
Disable Built-In Game Mode Completion;
Set Global Variable At Index(A, 0, Null);
Set Global Variable At Index(A, 1, Null);
Create HUD Text(All Players(Value In Array(Global Variable(A), 0)), String("{0}: {1}", String("{0} {1}", String("Round", Null,
Null, Null), String("Defeat", Null, Null, Null), Null), Round To Integer(Subtract(Match Time, 240), Up), Null), Null, Null,
Left, 10, Red, White, White, Visible To and String, Default Visibility);
Create HUD Text(All Players(Value In Array(Global Variable(A), 1)), String("{0}: {1}", String("{0} {1}", String("Round", Null,
Null, Null), String("Victory", Null, Null, Null), Null), Round To Integer(Subtract(Match Time, 240), Up), Null), Null, Null,
Left, 10, Blue, White, White, Visible To and String, Default Visibility);
}
}
rule("round started")
{
event
{
Ongoing - Global;
}
conditions
{
Is Game In Progress == True;
}
actions
{
Set Global Variable At Index(A, 0, Team 1);
Set Global Variable At Index(A, 1, Team 2);
}
}
rule("round ended")
{
event
{
Ongoing - Global;
}
conditions
{
Is Game In Progress == True;
Or(Compare(Match Time, <=, 240), Or(Compare(Number of Living Players(Team 1), ==, 0), Compare(Number of Living Players(Team 2), ==,
0))) == True;
Match Round >= 1;
}
actions
{
Pause Match Time;
Set Global Variable At Index(A, 0, Null);
Set Global Variable At Index(A, 1, Null);
Skip If(Or(Compare(Number of Living Players(Team 1), ==, 0), Compare(Match Time, <=, 240)), 2);
Declare Round Victory(Team 1);
Abort;
Skip If(Compare(Number of Living Players(Team 2), ==, 0), 2);
Declare Round Victory(Team 2);
Abort;
Skip If(Compare(Number of Living Players(All Teams), ==, 0), 1);
Declare Round Victory(All Teams);
}
}
rule("unpause timer")
{
event
{
Ongoing - Global;
}
conditions
{
Is Assembling Heroes == True;
Match Round >= 2;
}
actions
{
Unpause Match Time;
}
}
You have 2 ways to set a time of a match.
First one is by “Set Time Match(X);” action with condition “Is Game In Progress == True;”.
Second (if it is FFA) use the mode’ settings.
Additionally to what was posted above me you can use “Total time elapsed” as a timer. It is also good for individual timers like custom ability cooldowns.
- set variable(A, total time elapsed) — start the timer
- condition: subtract(total time elapsed, variable(A)) >= 10 — do something after 10 seconds
thank you everyone this really helps