1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FreezeTag MiniGame

Discussion in 'Requests' started by Contribe, Feb 13, 2019.

  1. C

    Contribe Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
    Category: Minigame Skript

    Suggested name: wym? of the skript? idc what you put

    What I want:
    a /queue command that queues up you for freeze tag "&7you queued for &bfreezetag!" {make sure if player quits while in queue it removes them} and when 3 players have queued at minimum the game starts and last for 3 minutes {3 2 1 minute and 30sec and 10-0 second countdown in chat} and also i would like to set the locations the team of players and the ONE freezer location they will spawn with /teamspawn <player> <freezer> also when the freezer hits somebody it freezes them and when a player hits somebody it unfreezes them and the message will be "&7player has been frozen" "&7player has been unfrozen" {message toggleable /freezetagmsg toggle with a shortcut of /ftm toggle" also if all of team 1 aka the players has been frozen by the team 2 aka the ONE player the freezer the game ends early and it will say "&bFreezer &8has won the game!" and if the freezer doesn't successfully freeze them all after 3 minutes it will be "&aPlayers &8have won the game!" and also i need a variable that i can use to trace individual player wins any questions pm me on discord Contribe#2249
    {Yes, i know this is a lot to ask but if you feel up to the project feel free to ask questions on discord}


    Ideas for commands:
    /queue
    /freeze
    /unfreeze
    /teamspawn


    Ideas for permissions:
    teamspawn.admin
    other commands should be public


    When I'd like it by: Friday 3:30 PM EST
     
  2. DieHollander_

    DieHollander_ Well-Known Member

    Joined:
    Mar 25, 2018
    Messages:
    165
    Likes Received:
    12
    Holy shit, not even gonna read that
     
  3. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    677
    Likes Received:
    48
    Medals:
    This is what I have right now, untested, tell me if something is missing / not working:
    Code (Text):
    1. options:
    2.     chat-prefix: &7[&dFreeze&eTag&7] &f
    3.  
    4. command /teamspawn <integer>:
    5.     permission: teamspawn.admin
    6.     trigger:
    7.         if arg-1 is not 1 or 2:
    8.             message "{@chat-prefix}&cUsage: &f/teamspawn <1|2>"
    9.             stop
    10.         set {freezetag::spawn::%arg-1%} to location of player
    11.         message "{@chat-prefix}Teamspawn set!"
    12.  
    13. command /queue:
    14.     trigger:
    15.         if player is not set:
    16.             message "{@chat-prefix}&cThis command is only executable by players!"
    17.         else:
    18.             add player to {freezetag::queue::*}
    19.             message "{@chat-prefix}You joined the queue."
    20.             freezetag_checkStart()
    21.  
    22. on disconnect:
    23.     {freezetag::queue::*} contains player
    24.     remove player from {freezetag::queue::*}
    25.  
    26. function freezetag_checkStart():
    27.     size of {freezetag::queue::*} >= 3
    28.     loop 180 times:
    29.         set {_i} to 181 - loop-number
    30.         if mod({_i}, 60) = 0:
    31.             broadcast "{@chat-prefix}Almost starting... %{_i}/60% minutes left!"
    32.         else if {_i} = 30:
    33.             broadcast "{@chat-prefix}30 seconds left, join while you still can!"
    34.         else if {_i} <= 10:
    35.             broadcast "{@chat-prefix}%{_i}% seconds left!"
    36.         wait 1 second
    37.     if size of {freezetag::queue::*} < 3:
    38.         broadcast "{@chat-prefix}Game cancelled: too few players joined."
    39.     else:
    40.         freezetag_start()
    41.  
    42. function freezetag_start():
    43.     set {_p::*} to {freezetag::queue::*}
    44.     size of {_p::*} >= 3
    45.     delete {freezetag::queue::*}
    46.     set {freezetag::game} to true
    47.     set {freezetag::game::players::*} to {_p::*}
    48.     set {freezetag::game::freezer} to random element out of {_p::*}
    49.     set {freezetag::game::team::*} to {_p::*}
    50.     remove {freezetag::game::freezer} from {freezetag::game::team::*}
    51.     broadcast "{@chat-prefix}Game starting..."
    52.     loop {_team::*}:
    53.         teleport loop-value to {freezetag::teamspawn::1}
    54.         set {freezetag::game::frozen::%loop-value%} to false
    55.     teleport {freezetag::game::freezer} to {freezetag::teamspawn::2}
    56.     loop 180 times:
    57.         set {_l::*} to {freezetag::game::frozen::*} where [input is true]
    58.         set {_s} to size of {_l::*}
    59.         set {_t::*} to {freezetag::game::team::*} where [input is online]
    60.         if {_s} is size of {_t::*}:
    61.             send "{@chat-prefix}Freezer (%{freezetag::game::freezer}%) has won the game!" to {_p::*}
    62.             delete {freezetag::game::*}
    63.             delete {freezetag::game}
    64.             loop {_p::*}:
    65.                 make loop-value-2 execute command "/spawn" # or other spawn code
    66.             #
    67.             #
    68.             # Freezer has won, put winner code here if you want to.
    69.             #
    70.             #
    71.             stop
    72.         wait 1 second
    73.     send "{@chat-prefix}Players have won the game!" to {_p::*}
    74.     delete {freezetag::game::*}
    75.     delete {freezetag::game}
    76.     loop {_p::*}:
    77.         make loop-value execute command "/spawn" # or other spawn code
    78.     #
    79.     #
    80.     # Players have won, put winner code here if you want to.
    81.     #
    82.     #
    83.  
    84. function freezetag_ftmMsg(msg: string):
    85.     set {_p::*} to {freezetag::game::players::*}
    86.     loop {_p::*} where [({freezetag::playerdata::%uuid of input%::ftm} ? true) is true]:
    87.         send {_msg} to loop-value
    88.  
    89. on damage:
    90.     damage cause is attack
    91.     attacker is set
    92.     {freezetag::game::players::*} contains victim
    93.     if {freezetag::game::freezer} is attacker:
    94.         set {freezetag::game::frozen::%victim%} to true
    95.         freezetag_ftmMsg("{@chat-prefix}&7%victim% has been frozen!")
    96.     else if {freezetag::game::frozen::%victim%} is true:
    97.         {freezetag::game::team::*} contains attacker
    98.         {freezetag::game::frozen::%attacker%} is false
    99.         set {freezetag::game::frozen::%victim%} to false
    100.         freezetag_ftmMsg("{@chat-prefix}&7%victim% has been unfrozen!")
    101.  
    102. on any movement:
    103.     ({freezetag::game::frozen::%player%} ? false) is true
    104.     cancel event
    105.  
    106. command /freezetagmsg [<text>]:
    107.     aliases: /ftm
    108.     trigger:
    109.         if arg-1 is not "toggle":
    110.             message "{@chat-prefix}&cUsage: &f/freezetagmsg toggle"
    111.         else:
    112.             set {_uuid} to uuid of player
    113.             if {freezetag::playerdata::%{_uuid}%::ftm} is true:
    114.                 set {freezetag::playerdata::%{_uuid}%::ftm} to false
    115.                 message "{@chat-prefix}Tag messages disabled"
    116.             else:
    117.                 set {freezetag::playerdata::%{_uuid}%::ftm} to true
    118.                 message "{@chat-prefix}Tag messages enabled"
     
    #3 TPGamesNL, Feb 13, 2019
    Last edited: Feb 13, 2019
  4. C

    Contribe Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
  5. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    677
    Likes Received:
    48
    Medals:
    Edited, try again
     
  6. C

    Contribe Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
    how do i make the queue game timer to 45 seconds instead of 3 minutes?


    also you can still do /queue while your already in the queue and also its like each player queues for the own little game because it sends it to everybody for each player that has joined like different games


    https://gyazo.com/8790c065363d04ce22ab67f5c33e6488
     
  7. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    677
    Likes Received:
    48
    Medals:
    Okay, new version:
    Code (Text):
    1. options:
    2.     chat-prefix: &7[&dFreeze&eTag&7] &f
    3.  
    4. command /teamspawn <integer>:
    5.     permission: teamspawn.admin
    6.     trigger:
    7.         if arg-1 is not 1 or 2:
    8.             message "{@chat-prefix}&cUsage: &f/teamspawn <1|2>"
    9.             stop
    10.         set {freezetag::teamspawn::%arg-1%} to location of player
    11.         message "{@chat-prefix}Teamspawn set!"
    12.  
    13. command /queue:
    14.     trigger:
    15.         if player is not set:
    16.             message "{@chat-prefix}&cThis command is only executable by players!"
    17.         else:
    18.             if {freezetag::queue::*} contains player:
    19.                 remove player from {freezetag::queue::*}
    20.                 message "{@chat-prefix}You left the queue."
    21.             else:
    22.                 add player to {freezetag::queue::*}
    23.                 message "{@chat-prefix}You joined the queue."
    24.                 freezetag_checkStart()
    25.  
    26. on disconnect:
    27.     {freezetag::queue::*} contains player
    28.     remove player from {freezetag::queue::*}
    29.  
    30. function freezetag_checkStart():
    31.     size of {freezetag::queue::*} >= 3
    32.     loop 45 times:
    33.         set {_i} to 181 - loop-number
    34.         if mod({_i}, 15) = 0:
    35.             broadcast "{@chat-prefix}Game almost starting, join while you still can!"
    36.         else if {_i} <= 10:
    37.             broadcast "{@chat-prefix}%{_i}% seconds left!"
    38.         wait 1 second
    39.     if size of {freezetag::queue::*} < 3:
    40.         broadcast "{@chat-prefix}Game cancelled: too few players joined."
    41.     else:
    42.         freezetag_start()
    43.  
    44. function freezetag_start():
    45.     set {_p::*} to {freezetag::queue::*}
    46.     size of {_p::*} >= 3
    47.     delete {freezetag::queue::*}
    48.     set {freezetag::game} to true
    49.     set {freezetag::game::players::*} to {_p::*}
    50.     set {freezetag::game::freezer} to random element out of {_p::*}
    51.     set {freezetag::game::team::*} to {_p::*}
    52.     remove {freezetag::game::freezer} from {freezetag::game::team::*}
    53.     broadcast "{@chat-prefix}Game starting..."
    54.     loop {_team::*}:
    55.         teleport loop-value to {freezetag::teamspawn::1}
    56.         set {freezetag::game::frozen::%loop-value%} to false
    57.     teleport {freezetag::game::freezer} to {freezetag::teamspawn::2}
    58.     loop 180 times:
    59.         set {_i} to 181 - loop-number
    60.         if mod({_i}, 60) = 0:
    61.             broadcast "{@chat-prefix}Game ends in %{_i}/60% minutes!"
    62.         else if {_i} = 30:
    63.             broadcast "{@chat-prefix}The game has 30 seconds left!"
    64.         else if {_i} <= 10:
    65.             broadcast "{@chat-prefix}%{_i}% seconds left!"
    66.         set {_l::*} to {freezetag::game::frozen::*} where [input is true]
    67.         set {_s} to size of {_l::*}
    68.         set {_t::*} to {freezetag::game::team::*} where [input is online]
    69.         if {_s} is size of {_t::*}:
    70.             send "{@chat-prefix}Freezer (%{freezetag::game::freezer}%) has won the game!" to {_p::*}
    71.             delete {freezetag::game::*}
    72.             delete {freezetag::game}
    73.             loop {_p::*}:
    74.                 make loop-value-2 execute command "/spawn" # or other spawn code
    75.             #
    76.             #
    77.             # Freezer has won, put winner code here if you want to.
    78.             #
    79.             #
    80.             stop
    81.         wait 1 second
    82.     send "{@chat-prefix}Players have won the game!" to {_p::*}
    83.     delete {freezetag::game::*}
    84.     delete {freezetag::game}
    85.     loop {_p::*}:
    86.         make loop-value execute command "/spawn" # or other spawn code
    87.     #
    88.     #
    89.     # Players have won, put winner code here if you want to.
    90.     #
    91.     #
    92.  
    93. function freezetag_ftmMsg(msg: string):
    94.     set {_p::*} to {freezetag::game::players::*}
    95.     loop {_p::*} where [({freezetag::playerdata::%uuid of input%::ftm} ? true) is true]:
    96.         send {_msg} to loop-value
    97.  
    98. on damage:
    99.     damage cause is attack
    100.     attacker is set
    101.     {freezetag::game::players::*} contains victim
    102.     if {freezetag::game::freezer} is attacker:
    103.         set {freezetag::game::frozen::%victim%} to true
    104.         freezetag_ftmMsg("{@chat-prefix}&7%victim% has been frozen!")
    105.     else if {freezetag::game::frozen::%victim%} is true:
    106.         {freezetag::game::team::*} contains attacker
    107.         {freezetag::game::frozen::%attacker%} is false
    108.         set {freezetag::game::frozen::%victim%} to false
    109.         freezetag_ftmMsg("{@chat-prefix}&7%victim% has been unfrozen!")
    110.  
    111. on any movement:
    112.     ({freezetag::game::frozen::%player%} ? false) is true
    113.     cancel event
    114.  
    115. command /freezetagmsg [<text>]:
    116.     aliases: /ftm
    117.     trigger:
    118.         if arg-1 is not "toggle":
    119.             message "{@chat-prefix}&cUsage: &f/freezetagmsg toggle"
    120.         else:
    121.             set {_uuid} to uuid of player
    122.             if {freezetag::playerdata::%{_uuid}%::ftm} is true:
    123.                 set {freezetag::playerdata::%{_uuid}%::ftm} to false
    124.                 message "{@chat-prefix}Tag messages disabled"
    125.             else:
    126.                 set {freezetag::playerdata::%{_uuid}%::ftm} to true
    127.                 message "{@chat-prefix}Tag messages enabled"
     
    #7 TPGamesNL, Feb 13, 2019
    Last edited: Feb 13, 2019
  8. C

    Contribe Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
    doesn't teleport players do you use /teamspawn as the 2 teams tp location right?
     
  9. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    677
    Likes Received:
    48
    Medals:
    You have to use /teamspawn 1 to set the location of the players' spawn, and you have to use /teamspawn 2 to set the location of the freezer
     
  10. C

    Contribe Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
    Aright I did that but players don’t teleport when the game starts
     
  11. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    677
    Likes Received:
    48
    Medals:
    Sorry, dumb mistake. Code updated
    --- Double Post Merged, Feb 14, 2019 at 1:40 PM, Original Post Date: Feb 13, 2019 ---
    New code:
    Code (Text):
    1. options:
    2.     chat-prefix: &7[&dFreeze&eTag&7] &f
    3.  
    4. command /teamspawn <integer>:
    5.     permission: teamspawn.admin
    6.     trigger:
    7.         if arg-1 is not 1 or 2:
    8.             message "{@chat-prefix}&cUsage: &f/teamspawn <1|2>"
    9.             stop
    10.         set {freezetag::teamspawn::%arg-1%} to location of player
    11.         message "{@chat-prefix}Teamspawn set!"
    12.  
    13. command /queue:
    14.     trigger:
    15.         if player is not set:
    16.             message "{@chat-prefix}&cThis command is only executable by players!"
    17.         else:
    18.             if {freezetag::queue::*} contains player:
    19.                 remove player from {freezetag::queue::*}
    20.                 message "{@chat-prefix}You left the queue."
    21.             else:
    22.                 add player to {freezetag::queue::*}
    23.                 message "{@chat-prefix}You joined the queue."
    24.                 freezetag_checkStart()
    25.  
    26. on disconnect:
    27.     {freezetag::queue::*} contains player
    28.     remove player from {freezetag::queue::*}
    29.  
    30. function freezetag_checkStart():
    31.     size of {freezetag::queue::*} >= 3
    32.     loop 45 times:
    33.         set {_i} to 181 - loop-number
    34.         if mod({_i}, 15) = 0:
    35.             broadcast "{@chat-prefix}Game almost starting, join while you still can!"
    36.         else if {_i} <= 10:
    37.             broadcast "{@chat-prefix}%{_i}% seconds left!"
    38.         wait 1 second
    39.     if size of {freezetag::queue::*} < 3:
    40.         broadcast "{@chat-prefix}Game cancelled: too few players joined."
    41.     else:
    42.         freezetag_start()
    43.  
    44. function freezetag_start():
    45.     set {_p::*} to {freezetag::queue::*}
    46.     size of {_p::*} >= 3
    47.     delete {freezetag::queue::*}
    48.     set {freezetag::game} to true
    49.     set {freezetag::game::players::*} to {_p::*}
    50.     set {freezetag::game::freezer} to random element out of {_p::*}
    51.     set {freezetag::game::team::*} to {_p::*}
    52.     remove {freezetag::game::freezer} from {freezetag::game::team::*}
    53.     set {_team::*} to {freezetag::game::team::*}
    54.     broadcast "{@chat-prefix}Game starting..."
    55.     send "{@chat-prefix}The freezer is %{_freezer}%" to {_p::*}
    56.     loop {_team::*}:
    57.         teleport loop-value to {freezetag::teamspawn::1}
    58.         send "{@chat-prefix}You are a player" to loop-value
    59.         set {freezetag::game::frozen::%loop-value%} to false
    60.     send "{@chat-prefix}You are the freezer" to {_freezer}
    61.     teleport {freezetag::game::freezer} to {freezetag::teamspawn::2}
    62.     loop 180 times:
    63.         set {_i} to 181 - loop-number
    64.         if mod({_i}, 60) = 0:
    65.             broadcast "{@chat-prefix}Game ends in %{_i}/60% minutes!"
    66.         else if {_i} = 30:
    67.             broadcast "{@chat-prefix}The game has 30 seconds left!"
    68.         else if {_i} <= 10:
    69.             broadcast "{@chat-prefix}%{_i}% seconds left!"
    70.         set {_l::*} to {freezetag::game::frozen::*} where [input is true]
    71.         set {_s} to size of {_l::*}
    72.         set {_t::*} to {freezetag::game::team::*} where [input is online]
    73.         if {_s} is size of {_t::*}:
    74.             send "{@chat-prefix}Freezer (%{freezetag::game::freezer}%) has won the game!" to {_p::*}
    75.             delete {freezetag::game::*}
    76.             delete {freezetag::game}
    77.             loop {_p::*}:
    78.                 make loop-value-2 execute command "/spawn" # or other spawn code
    79.             #
    80.             #
    81.             # Freezer has won, put winner code here if you want to.
    82.             #
    83.             #
    84.             stop
    85.         wait 1 second
    86.     send "{@chat-prefix}Players have won the game!" to {_p::*}
    87.     delete {freezetag::game::*}
    88.     delete {freezetag::game}
    89.     loop {_p::*}:
    90.         make loop-value execute command "/spawn" # or other spawn code
    91.     #
    92.     #
    93.     # Players have won, put winner code here if you want to.
    94.     #
    95.     #
    96.  
    97. function freezetag_ftmMsg(msg: string):
    98.     set {_p::*} to {freezetag::game::players::*}
    99.     loop {_p::*} where [({freezetag::playerdata::%uuid of input%::ftm} ? true) is true]:
    100.         send {_msg} to loop-value
    101.  
    102. on damage:
    103.     damage cause is attack
    104.     attacker is set
    105.     {freezetag::game::players::*} contains victim
    106.     if {freezetag::game::freezer} is attacker:
    107.         set {freezetag::game::frozen::%victim%} to true
    108.         freezetag_ftmMsg("{@chat-prefix}&7%victim% has been frozen!")
    109.     else if {freezetag::game::frozen::%victim%} is true:
    110.         {freezetag::game::team::*} contains attacker
    111.         {freezetag::game::frozen::%attacker%} is false
    112.         set {freezetag::game::frozen::%victim%} to false
    113.         freezetag_ftmMsg("{@chat-prefix}&7%victim% has been unfrozen!")
    114.  
    115. on any movement:
    116.     ({freezetag::game::frozen::%player%} ? false) is true
    117.     cancel event
    118.  
    119. command /freezetagmsg [<text>]:
    120.     aliases: /ftm
    121.     trigger:
    122.         if arg-1 is not "toggle":
    123.             message "{@chat-prefix}&cUsage: &f/freezetagmsg toggle"
    124.         else:
    125.             set {_uuid} to uuid of player
    126.             if {freezetag::playerdata::%{_uuid}%::ftm} is true:
    127.                 set {freezetag::playerdata::%{_uuid}%::ftm} to false
    128.                 message "{@chat-prefix}Tag messages disabled"
    129.             else:
    130.                 set {freezetag::playerdata::%{_uuid}%::ftm} to true
    131.                 message "{@chat-prefix}Tag messages enabled"
     
  12. C

    Contribe Member

    Joined:
    Feb 12, 2019
    Messages:
    6
    Likes Received:
    0
  13. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    677
    Likes Received:
    48
    Medals:
    Try
    Code (Text):
    1.  
    2. options:
    3.     chat-prefix: &7[&bFreeze&eTag&7] &f
    4.  
    5. command /teamspawn <integer>:
    6.     permission: teamspawn.admin
    7.     trigger:
    8.         if arg-1 is not 1 or 2:
    9.             message "{@chat-prefix}&cUsage: &f/teamspawn <1|2>"
    10.             stop
    11.         set {freezetag::teamspawn::%arg-1%} to location of player
    12.         message "{@chat-prefix}Teamspawn set!"
    13.  
    14. command /queue:
    15.     trigger:
    16.         if player is not set:
    17.             message "{@chat-prefix}&cThis command is only executable by players!"
    18.         else:
    19.             if {freezetag::queue::*} contains player:
    20.                 remove player from {freezetag::queue::*}
    21.                 message "{@chat-prefix}You left the queue."
    22.             else:
    23.                 add player to {freezetag::queue::*}
    24.                 message "{@chat-prefix}You joined the queue."
    25.                 freezetag_checkStart()
    26.  
    27. on disconnect:
    28.     {freezetag::queue::*} contains player
    29.     remove player from {freezetag::queue::*}
    30.  
    31. function freezetag_checkStart():
    32.     size of {freezetag::queue::*} >= 3
    33.     loop 45 times:
    34.         set {_i} to 181 - loop-number
    35.         if mod({_i}, 15) = 0:
    36.             broadcast "{@chat-prefix}Game almost starting, join while you still can!"
    37.         else if {_i} <= 10:
    38.             broadcast "{@chat-prefix}%{_i}% seconds left!"
    39.         wait 1 second
    40.     if size of {freezetag::queue::*} < 3:
    41.         broadcast "{@chat-prefix}Game cancelled: too few players joined."
    42.     else:
    43.         freezetag_start()
    44.  
    45. function freezetag_start():
    46.     set {_p::*} to {freezetag::queue::*}
    47.     size of {_p::*} >= 3
    48.     delete {freezetag::queue::*}
    49.     set {freezetag::game} to true
    50.     set {freezetag::game::players::*} to {_p::*}
    51.     set {freezetag::game::freezer} to random element out of {_p::*}
    52.     set {freezetag::game::team::*} to {_p::*}
    53.     remove {freezetag::game::freezer} from {freezetag::game::team::*}
    54.     set {_team::*} to {freezetag::game::team::*}
    55.     broadcast "{@chat-prefix}Game starting..."
    56.     send "{@chat-prefix}The freezer is %{freezetag::game::freezer}%" to {_p::*}
    57.     loop {_team::*}:
    58.         clear inventory of loop-value
    59.         teleport loop-value to {freezetag::teamspawn::1}
    60.         send "{@chat-prefix}You are a player" to loop-value
    61.         set {freezetag::game::frozen::%loop-value%} to false
    62.     send "{@chat-prefix}You are the freezer" to {_freezer}
    63.     clear inventory of {freezetag::game::freezer}
    64.     teleport {freezetag::game::freezer} to {freezetag::teamspawn::2}
    65.     loop 180 times:
    66.         set {_i} to 181 - loop-number
    67.         if mod({_i}, 60) = 0:
    68.             broadcast "{@chat-prefix}Game ends in %{_i}/60% minutes!"
    69.         else if {_i} = 30:
    70.             broadcast "{@chat-prefix}The game has 30 seconds left!"
    71.         else if {_i} <= 10:
    72.             broadcast "{@chat-prefix}%{_i}% seconds left!"
    73.         set {_l::*} to {freezetag::game::frozen::*} where [input is true]
    74.         set {_s} to size of {_l::*}
    75.         set {_t::*} to {freezetag::game::team::*} where [input is online]
    76.         if {_s} is size of {_t::*}:
    77.             send "{@chat-prefix}Freezer (%{freezetag::game::freezer}%) has won the game!" to {_p::*}
    78.             set {_freezer} to {freezetag::game::freezer}
    79.             delete {freezetag::game::*}
    80.             delete {freezetag::game}
    81.             loop {_p::*}:
    82.                 make loop-value-2 execute command "/spawn" # or other spawn code
    83.             #
    84.             #
    85.             # Freezer has won, put winner code here if you want to. Freezer variable is {_freezer}
    86.             #
    87.             #
    88.             stop
    89.         wait 1 second
    90.     send "{@chat-prefix}Players have won the game!" to {_p::*}
    91.     delete {freezetag::game::*}
    92.     delete {freezetag::game}
    93.     loop {_p::*}:
    94.         clear inventory of loop-value
    95.         make loop-value execute command "/spawn" # or other spawn code
    96.     #
    97.     #
    98.     # Players have won, put winner code here if you want to. Player list variable: {_p::*}
    99.     #
    100.     #
    101.  
    102. function freezetag_ftmMsg(msg: string):
    103.     set {_p::*} to {freezetag::game::players::*}
    104.     loop {_p::*} where [({freezetag::playerdata::%uuid of input%::ftm} ? true) is true]:
    105.         send {_msg} to loop-value
    106.  
    107. on damage:
    108.     damage cause is attack
    109.     attacker is set
    110.     {freezetag::game::players::*} contains victim
    111.     if {freezetag::game::freezer} is attacker:
    112.         set {freezetag::game::frozen::%victim%} to true
    113.         freezetag_ftmMsg("{@chat-prefix}&7%victim% has been frozen!")
    114.     else if {freezetag::game::frozen::%victim%} is true:
    115.         {freezetag::game::team::*} contains attacker
    116.         {freezetag::game::frozen::%attacker%} is false
    117.         set {freezetag::game::frozen::%victim%} to false
    118.         freezetag_ftmMsg("{@chat-prefix}&7%victim% has been unfrozen!")
    119.  
    120. on any movement:
    121.     {freezetag::game::frozen::%player%} is true
    122.     cancel event
    123.  
    124. command /freezetagmsg [<text>]:
    125.     aliases: /ftm
    126.     trigger:
    127.         if arg-1 is not "toggle":
    128.             message "{@chat-prefix}&cUsage: &f/freezetagmsg toggle"
    129.         else:
    130.             set {_uuid} to uuid of player
    131.             if {freezetag::playerdata::%{_uuid}%::ftm} is true:
    132.                 set {freezetag::playerdata::%{_uuid}%::ftm} to false
    133.                 message "{@chat-prefix}Tag messages disabled"
    134.             else:
    135.                 set {freezetag::playerdata::%{_uuid}%::ftm} to true
    136.                 message "{@chat-prefix}Tag messages enabled"
    137.  
     
    #13 TPGamesNL, Feb 16, 2019 at 8:54 AM
    Last edited: Feb 18, 2019 at 9:02 AM
Loading...