Hunger Games [Fully Functional !!!]

PolyBossX

Staff member
Community Moderator
#1
Hello guys, I first want to let you know that this code would not at all be possible to even post here on the forums if it weren't for [MagmaCreep] !!!
Magma helped me setup the code procedure and protocol, I made the parts where and what happens to the players before and around the start up.
This is a fully functional Hunger Games code. However, what I will post has been modified on my pervious LEET server, therefor you'll need to understand the code and know how to edit it your self for it to be functional. That being said here it is ! ->

[ PLEASE READ: Please do not copy this and add it to your server, this is mine and Magmas version of Hungergames and will not work functionally if you just copy. You must know how this process works for it to be functional, meaning more than likely you will need to EDIT mostly every line of code to best work it on your server.

cmd create pvp
cmd add pvp load %pvp%
cmd add pvp if varset(%pvp%) then goto 5
cmd add pvp let %pvp% = array()
cmd add pvp let %pvp% = %pvp% - array()
cmd add pvp if %p% in %pvp% then message %p% §cYou are already in death match!
cmd add pvp if %p% in %pvp% then exit
cmd add pvp let %pvp% = array(%pvp%, %p%)
cmd add pvp save %pvp%
cmd add pvp message %p% §aSuccessfully joined Moon Wars
cmd add pvp move %p% world 488.5 86 359.5
cmd add pvp if size(%pvp%) = 10 then goto 13
cmd add pvp exit
cmd add pvp ascon /cmd run pvpwinner
cmd add pvp load %pvp%
cmd add pvp let %player1% = replace(%pvp%["0"], \"[]\", \"\")
cmd add pvp let %player2% = replace(%pvp%["1"], \"[]\", \"\")
cmd add pvp let %player3% = replace(%pvp%["2"], \"[]\", \"\")
cmd add pvp let %player4% = replace(%pvp%["3"], \"[]\", \"\")
cmd add pvp let %player5% = replace(%pvp%["4"], \"[]\", \"\")
cmd add pvp let %player6% = replace(%pvp%["5"], \"[]\", \"\")
cmd add pvp let %player7% = replace(%pvp%["6"], \"[]\", \"\")
cmd add pvp let %player8% = replace(%pvp%["7"], \"[]\", \"\")
cmd add pvp let %player9% = replace(%pvp%["8"], \"[]\", \"\")
cmd add pvp let %player10% = replace(%pvp%["9"], \"[]\", \"\")

[ storing/removing players inventory ]

cmd add pvp asop /storeinventory %player1%
cmd add pvp asop /storeinventory %player2%
cmd add pvp asop /storeinventory %player3%
cmd add pvp asop /storeinventory %player4%
cmd add pvp asop /storeinventory %player5%
cmd add pvp asop /storeinventory %player6%
cmd add pvp asop /storeinventory %player7%
cmd add pvp asop /storeinventory %player8%
cmd add pvp asop /storeinventory %player9%
cmd add pvp asop /storeinventory %player10%
cmd add pvp asop /setinventory %player1% 0
cmd add pvp asop /setinventory %player2% 0
cmd add pvp asop /setinventory %player3% 0
cmd add pvp asop /setinventory %player4% 0
cmd add pvp asop /setinventory %player5% 0
cmd add pvp asop /setinventory %player6% 0
cmd add pvp asop /setinventory %player7% 0
cmd add pvp asop /setinventory %player8% 0
cmd add pvp asop /setinventory %player9% 0
cmd add pvp asop /setinventory %player10% 0
cmd add pvp asop /setarmor %player1% 0 0 0 0
cmd add pvp asop /setarmor %player2% 0 0 0 0
cmd add pvp asop /setarmor %player3% 0 0 0 0
cmd add pvp asop /setarmor %player4% 0 0 0 0
cmd add pvp asop /setarmor %player5% 0 0 0 0
cmd add pvp asop /setarmor %player6% 0 0 0 0
cmd add pvp asop /setarmor %player7% 0 0 0 0
cmd add pvp asop /setarmor %player8% 0 0 0 0
cmd add pvp asop /setarmor %player9% 0 0 0 0
cmd add pvp asop /setarmor %player10% 0 0 0 0
cmd add pvp move %player1% world 692.5 91 354.5
cmd add pvp move %player2% world 698.5 91 351.5
cmd add pvp move %player3% world 708.5 91 351.5
cmd add pvp move %player4% world 714.5 91 354.5
cmd add pvp move %player5% world 718.5 91 365.5
cmd add pvp move %player6% world 714.5 91 376.5
cmd add pvp move %player7% world 708.5 91 379.5
cmd add pvp move %player8% world 698.5 91 379.5
cmd add pvp move %player9% world 692.5 91 376.5
cmd add pvp move %player10% world 688.5 91 365.5

[This is restoring the items in chests ]

cmd add pvp /copyblock world 692 84 368 702 90 366
cmd add pvp /copyblock world 691 84 367 702 91 365
cmd add pvp /copyblock world 690 84 366 702 90 364
cmd add pvp /copyblock world 691 84 365 703 91 364
cmd add pvp /copyblock world 692 84 364 704 90 364
cmd add pvp /copyblock world 693 84 365 704 91 365
cmd add pvp /copyblock world 694 84 366 704 90 366
cmd add pvp /copyblock world 693 84 367 703 91 366

[ This section here adds and removes invisible bedrock to prevent players from leaving there pedestal before the game starts]

cmd add pvp #Position 1
cmd add pvp /setblock world 692 92 353 95
cmd add pvp /setblock world 693 92 354 95
cmd add pvp /setblock world 692 92 355 95
cmd add pvp /setblock world 691 92 354 95
cmd add pvp #Position 2
cmd add pvp /setblock world 698 92 350 95
cmd add pvp /setblock world 699 92 351 95
cmd add pvp /setblock world 698 92 352 95
cmd add pvp /setblock world 697 92 351 95
cmd add pvp #Position 3
cmd add pvp /setblock world 708 92 350 95
cmd add pvp /setblock world 709 92 351 95
cmd add pvp /setblock world 708 92 352 95
cmd add pvp /setblock world 707 92 351 95
cmd add pvp #Position 4
cmd add pvp /setblock world 714 92 353 95
cmd add pvp /setblock world 715 92 354 95
cmd add pvp /setblock world 714 92 355 95
cmd add pvp /setblock world 713 92 354 95
cmd add pvp #Position 5
cmd add pvp /setblock world 718 92 364 95
cmd add pvp /setblock world 719 92 365 95
cmd add pvp /setblock world 718 92 366 95
cmd add pvp /setblock world 717 92 365 95
cmd add pvp #Position 6
cmd add pvp /setblock world 714 92 375 95
cmd add pvp /setblock world 715 92 376 95
cmd add pvp /setblock world 714 92 377 95
cmd add pvp /setblock world 713 92 376 95
cmd add pvp #Position 7
cmd add pvp /setblock world 708 92 378 95
cmd add pvp /setblock world 709 92 379 95
cmd add pvp /setblock world 708 92 380 95
cmd add pvp /setblock world 707 92 379 95
cmd add pvp #Position 8
cmd add pvp /setblock world 698 92 378 95
cmd add pvp /setblock world 699 92 379 95
cmd add pvp /setblock world 698 92 380 95
cmd add pvp /setblock world 697 92 379 95
cmd add pvp #Position 9
cmd add pvp /setblock world 692 92 375 95
cmd add pvp /setblock world 693 92 376 95
cmd add pvp /setblock world 692 92 377 95
cmd add pvp /setblock world 391 92 376 95
cmd add pvp #Position 10
cmd add pvp /setblock world 688 92 364 95
cmd add pvp /setblock world 689 92 365 95
cmd add pvp /setblock world 688 92 366 95
cmd add pvp /setblock world 687 92 365 95
cmd add pvp title %p% §6Starting in §b5
cmd add pvp sleep 1
cmd add pvp title %p% §6Starting in §b4
cmd add pvp sleep 1
cmd add pvp title %p% §6Starting in §b3
cmd add pvp sleep 1
cmd add pvp title %p% §6Starting in §b2
cmd add pvp sleep 1
cmd add pvp title %p% §6Starting in §b1
cmd add pvp sleep 1
cmd add pvp title %p% §a Goooo !
cmd add pvp sleep 1
cmd add pvp #Position 1
cmd add pvp /setblock world 692 92 353 0
cmd add pvp /setblock world 693 92 354 0
cmd add pvp /setblock world 692 92 355 0
cmd add pvp /setblock world 691 92 354 0
cmd add pvp #Position 2
cmd add pvp /setblock world 698 92 350 0
cmd add pvp /setblock world 699 92 351 0
cmd add pvp /setblock world 698 92 352 0
cmd add pvp /setblock world 697 92 351 0
cmd add pvp #Position 3
cmd add pvp /setblock world 708 92 350 0
cmd add pvp /setblock world 709 92 351 0
cmd add pvp /setblock world 708 92 352 0
cmd add pvp /setblock world 707 92 351 0
cmd add pvp #Position 4
cmd add pvp /setblock world 714 92 353 0
cmd add pvp /setblock world 715 92 354 0
cmd add pvp /setblock world 714 92 355 0
cmd add pvp /setblock world 713 92 365 0
cmd add pvp #Position 5
cmd add pvp /setblock world 718 92 364 0
cmd add pvp /setblock world 719 92 365 0
cmd add pvp /setblock world 718 92 366 0
cmd add pvp /setblock world 717 92 365 0
cmd add pvp #Position 6
cmd add pvp /setblock world 714 92 375 0
cmd add pvp /setblock world 715 92 376 0
cmd add pvp /setblock world 714 92 377 0
cmd add pvp /setblock world 713 92 376 0
cmd add pvp #Position 7
cmd add pvp /setblock world 708 92 378 0
cmd add pvp /setblock world 709 92 379 0
cmd add pvp /setblock world 708 92 380 0
cmd add pvp /setblock world 707 92 379 0
cmd add pvp #Position 8
cmd add pvp /setblock world 698 92 378 0
cmd add pvp /setblock world 699 92 379 0
cmd add pvp /setblock world 698 92 380 0
cmd add pvp /setblock world 697 92 379 0
cmd add pvp #Position 9
cmd add pvp /setblock world 692 92 375 0
cmd add pvp /setblock world 693 92 376 0
cmd add pvp /setblock world 692 92 377 0
cmd add pvp /setblock world 391 92 376 0
cmd add pvp #Position 10
cmd add pvp /setblock world 688 92 364 0
cmd add pvp /setblock world 689 92 365 0
cmd add pvp /setblock world 688 92 366 0
cmd add pvp /setblock world 687 92 365 0

[ The rest is regarding the end of the game.]

cmd add pvp # the rest below dont mess with
cmd add pvp sleep 120
cmd add pvp load %pvp%
cmd add pvp if size(%pvp%) = 1 then exit
cmd add pvp message %pvp% Death match going to end after 2 minutes
cmd add pvp sleep 120
cmd add pvp load %pvp%
cmd add pvp if size(%pvp%) = 1 then exit
cmd add pvp message %pvp% Death match ended
cmd add pvp move %player1% world 247.5 21 363.5
cmd add pvp move %player2% world 247.5 21 363.5
cmd add pvp asop /restoreinventory %player1%
cmd add pvp asop /restoreinventory %player2%
cmd add pvp let %pvp% = array()
cmd add pvp let %pvp% = %pvp% - array()
cmd add pvp save %pvp%
cmd add pvp exit

Even thought I have created the code content of this command, It wouldn't be functional or even possible If magma haven't helped me out, please DM him and say 'thanks' if you plan on using this. Many thanks and have a wonderful day :D
 
#2
wow
nice
well i will have to try it out
good thing is I wait long enough for this code
since magma was asking $25 for this
thx I'll let u know if this actually works
 

PolyBossX

Staff member
Community Moderator
#7
Guys here is the [Winner] code as mentioned in the code


cmd create pvpwinner
cmd add pvpwinner load %pvp%
cmd add pvpwinner if size(%pvp%) = 1 then goto 6
cmd add pvpwinner if size(%pvp%) = 0 then exit
cmd add pvpwinner sleep 1
cmd add pvpwinner goto 1
cmd add pvpwinner let %winner% = replace(%pvp%["0"], \"[]\", \"\")
cmd add pvpwinner move %winner% world 247.5 21 363.5
cmd add pvpwinner asop /restoreinventory %winner%
cmd add pvpwinner message onlineplayers() §b%winner% §6has win §dMoon Wars!
cmd add pvpwinner let %pvp% = array()
cmd add pvpwinner let %pvp% = %pvp% - array()
cmd add pvpwinner save %pvp%
cmd add pvpwinner exit
 
#8
I don't understand how this works. A few questions:

I did not find in the code a line which checks if a player got killed. Or a command for the death/leave trigger.

What about all players died except of one? Does this one have to wait until the game ends (120 seconds)?

Well done!

Thank you,
Melonenbubi
 

PolyBossX

Staff member
Community Moderator
#9
I don't understand how this works. A few questions:

I did not find in the code a line which checks if a player got killed. Or a command for the death/leave trigger.

What about all players died except of one? Does this one have to wait until the game ends (120 seconds)?

Well done!

Thank you,
Melonenbubi
Well here in this code such structure is made through the array that is set based on how many people set in the game. Also look at my second reply adding the structure that dictates the actions that take place if there is 1 person left in the game based on the array of players . This code does not have death match added.