I need help with my mini game!

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
If I remove the setspawn would it remove the teleportation to the map or would I just have to change the.

if {sf.players} is 0:

teleport the player to {sf.spawn1.%arg 2%}

if {sf.players} is 1:

teleport the player to {sf.spawn2.%arg 2%}

to.

if {sf.players} is 0:

teleport the player to {sf.cagespawn1.%arg-3%}

if {sf.players} is 1:

teleport the player to {sf.cagespawn2.%arg-3%}


Youre right
You only have to change it =)

code_language.skript:
set {_cx} to 1
loop {sf::*}:
     teleport loop-value to {sf.cagespawn%{_cx}%}
     add 1 to {_cx}
 
Okay so I tried the script with my friend and the reloading map script did not work and the kits still get removed when you leave the game???
 
This should be fixed now
After reloading I had my saved kits
code_language.skript:
options:
    logo: &8[&9Sky&3Fight&8]
 
#--------------------------------------#
 
variables:
  
    {sf.game} = false
    {sf.world} = false
    {sf.players} = 0
    {sf.pb} = false
    {sfjoin.%player%} = false
    {sf.delay} = false
    {sf.enter} = false
    {sf.amount} = true
    {sf.pvp} = false
  
#-----------------------------------LEAVE-COMMAND#
 
command /leave:
    trigger:
        if {sfjoin.%player%} is true:
          
            if {sf.game} is true:
                clear {sf::*}'s inventory
                teleport {sf::*} to {sf.hub}
                set {sf.game} to false
                set {sf.world} to false
                set {sf.players} to 0
                set {sf.pb} to false
                set {sf.delay} to false
                set {sfjoin.%player%} to false
                message "{@logo}&4You left the game!"
                delete {sf::*}
                execute console command "/mapreset"
                delete {minigame.arenaname.breakblocks::*}
                delete {minigame.arenaname.breaklocations::*}
                delete {minigame.arenaname.placeblocks::*}
                delete {minigame.arenaname.placelocations::*}
              
                set {_count} to 0
                loop 41 times:
                    set slot {_count} of player to {inv.%player%::%{_count}%}
                    add 1 to {_count}
          
            else:
          
                set {sf.game} to false
                set {sf.world} to false
                set {sf.players} to 0
                set {sf.pb} to false
                set {sfjoin.%player%} to false
                message "{@logo}&4You left the game!"
                clear the player's inventory
                teleport the player to {sf.hub}
                delete {sf::*}
                execute console command "/mapresetx"
                delete {minigame.arenaname.breakblocks::*}
                delete {minigame.arenaname.breaklocations::*}
                delete {minigame.arenaname.placeblocks::*}
                delete {minigame.arenaname.placelocations::*}
              
                set {_count} to 0
                loop 41 times:
                    set slot {_count} of player to {inv.%player%::%{_count}%}
                    add 1 to {_count}
          
        else: 
          
            message "{@logo}&4You are not in a game!"
  
#----------------------------MAIN-COMMAND#
  
command /sf <text> <text> [<text>] [<text>]:
    usage: &9/&3sf "&2join&9" "&bmap&9" "&amode&9"
    trigger: 
#------------------------------ADMIN-COMMAND# 
        if arg 1 is "admin":
      
            if player has permission "sf.admin":
          
                if arg 2 is "sethub":
              
                    set {sf.hub} to location of player
                    message "{@logo}&bYou set the hub!"
              
                if arg 2 is "setspawn1":
              
                    set {sf.spawn1.%arg 3%} to location of player
                    message "{@logo}&bYou set spawn1 for %arg 3%!"
          
                if arg 2 is "setspawn2":
              
                    set {sf.spawn2.%arg 3%} to location of player
                    message "{@logo}&bYou set spawn2 for %arg 3%!" 
          
                if arg 2 is "remake":
                  
                    loop {sf.%world%.breakblocks::*}:
                        loop {sf.%world%.breaklocations::*}:
                            set {_loc} to loop-value-2
                            set block at {_loc} to {sf.%world%.breakblocks::%loop-index-2%}
                if arg 2 is "setcages":
                    
                    if arg 3 is set:
                    
                        set {sf.cagespawn%arg-4%.%arg-3%} to location of player
                        message "{@logo}&bYou set cage spawn %arg-4% for %arg 3%!"
            else:
                message "&4You are not a admin!"
          
#---------------------------------------------NORMAL-COMMAND#
 
        if arg 1 is "join":
              
            if arg 2 is "simple":

                if {sfjoin.%player%} is true:
                                  
                    message "&4You are already in a game!"
                else:   
                    if {sf.game} is true:
                                          
                        message "&4That game has already started!"
                    else:   
                        if {sf.delay} is true:
                                                  
                            message "&4That game needs to cool down!"
                        else:                           
                            if {sf.world} is true:
                                                
                                message "&4That game needs to restart!"
                            else:                   
                                if {sfjoin.%player%} is false:
                                                                                              
                                    execute console command "/day day simple"
                                                                                          
                                    set {_count} to 0
                                    loop 41 times:
                                        set {inv.%player%::%{_count}%} to slot {_count} of player
                                        add 1 to {_count}
                                                                                              
                                    clear the player's inventory
                                    add player to {sf::*}
                                    add 1 to {sf.players}
                                    send "{@logo}&b%player% Joined the game!" to {sf::*}
                                    set player's gamemode to survival
                                    give player nether star named "&bKits"
                                    set {sfjoin.%player%} to true
                                    set {sf.pb} to false
          
    #----------------------------------------------------------------GAME-START#
                      
                                    if {sf.players} is 2:
                                      
                                        wait 10 ticks
                                      
                                        set {sf.game} to true
                                        set {sf.pvp} to false
                                                    
                                        loop {sf::*}:
                                            teleport loop-value to {sf.cagespawn%loop-index%.map}
                                            
                                        send "{@logo}&bThe game is starting in 20 seconds!" to {sf::*}
                                                              
                                        wait 10 seconds
                                        send "{@logo}&b10 seconds till the game starts" to {sf::*}
                                                              
                                        wait 5 seconds
                                        send "{@logo}&b5!" to {sf::*}
                                                              
                                        wait 1 second
                                        send "{@logo}&b4!" to {sf::*}
                                                              
                                        wait 1 second
                                        send "{@logo}&b3!" to {sf::*}
                                                              
                                        wait 1 second
                                        send "{@logo}&b2!" to {sf::*}
                                                              
                                        wait 1 second
                                        send "{@logo}&b1!" to {sf::*}
                                                    
                                        loop {sf::*}:
                                            set block under loop-value to air
                                        set {nodmg.%player%} to true
                                        wait 3 seconds
                                        delete {nodmg.%player%}
                                        wait 1 second
                                        send "{@logo}&bGO!" to {sf::*}
                                                          
                                        set {sf.pb} to true
                                                          
                                        remove 1 nether star from the inventory of {sf::*}
                                                              
                                        send "{@logo}&bIn 5 minutes you will be allowed to fight!" to {sf::*}
                                                          
                                        wait 3 minutes
                                        send "{@logo}&bIn 2 minutes you will be allowed to fight!" to {sf::*}
                                                              
                                        wait 2 minutes
                                        send "{@logo}&bTHE PVP GODS ARE TAKING A NAP! THERE ARE NO RULES!" to {sf::*} 
                                        set {sf.pvp} to true
 
#------------------------------------------------------KITS#
 
 
 
command /sfkit [<text>] [<number>]:
 
    trigger:
          
        if arg 1 is "create":       
      
            if arg 2 is set: 
          
                wait 2 ticks
                message "{@logo}&bKit %arg 2% Created!"
              
                loop all items in player's inventory:   
              
                    add loop-item to {sfkit-%arg-2%.%player%::*}
                  
        if arg 1 is "delete":
      
            if arg 2 is set:
          
                message "{@logo}&bKit %arg 2% Deleted!"
                clear {sfkit-%arg-2%.%player%::*}
              
        if arg 1 is "use":
      
            if arg 2 is set:
          
                if {sfjoin.%player%} is true:
              
                    message "{@logo}&bKit %arg 2% Loaded!"
                    clear the player's inventory
                    give player nether star named "&4Kits"
                  
                    loop {sfkit-%arg-2%.%player%::*}:
                  
                        add loop-value to the player's inventory
  
on rightclick holding nether star:
 
    if {sfjoin.%player%} is true:
  
        open chest with 1 rows named "&4Kits" to player 
      
        wait 1 tick
      
        if {sfkit-1.%player%::*} is set:
      
            format slot 0 of player with iron ingot named "&8Iron" to close then run [make player execute command "/sfkit use 1"]
          
        if {sfkit-2.%player%::*} is set:
      
            format slot 1 of player with gold ingot named "&eGold" to close then run [make player execute command "/sfkit use 2"]
          
        if {sfkit-3.%player%::*} is set:
      
            format slot 2 of player with diamond named "&bDiamond" to close then run [make player execute command "/sfkit use 3"]
  
#-----------------------------------------------------------------KIT-OPTIONS#
          
command /sfkitdelete:
 
    trigger:
 
        wait 2 ticks
  
        if {sfjoin.%player%} is false: 
      
            open chest with 1 rows named "&4Delete Kits" to player 
          
            wait 1 tick 
          
            if {sfkit-1.%player%::*} is set:
          
                format slot 0 of player with iron ingot named "&8Delete Kit Iron" to close then run [make player execute command "/sfkit delete 1"]
              
            if {sfkit-2.%player%::*} is set:
          
                format slot 1 of player with gold ingot named "&eDelete Kit Gold" to close then run [make player execute command "/sfkit delete 2"]
              
            if {sfkit-3.%player%::*} is set:
          
                format slot 2 of player with diamond named "&bDelete Kit Diamond" to close then run [make player execute command "/sfkit delete 3"]
 
            format slot 8 of player with nether star named "&9Create" to close then run [make player execute command "/sfkitcreate"]
 
command /sfkitcreate:
 
    trigger:
      
        wait 2 ticks
      
        if {sfjoin.%player%} is false:
      
            open chest with 1 rows named "&9Create Kits" to player
      
            wait 1 tick
      
            if {sfkit-1.%player%::*} is not set:
      
                format slot 0 of player with iron ingot named "&8Create Kit Iron" to close then run [make player execute command "/sfkit create 1"]
              
            if {sfkit-2.%player%::*} is not set:
      
                format slot 1 of player with gold ingot named "&eCreate Kit Gold" to close then run [make player execute command "/sfkit create 2"]
  
            if {sfkit-3.%player%::*} is not set:
      
                format slot 2 of player with diamond named "&bCreate Kit Diamond" to close then run [make player execute command "/sfkit create 3"]
  
            format slot 8 of player with barrier named "&4Delete" to close then run [make player execute command "/sfkitdelete"]
  
on rightclick holding arrow:
  
    make player execute command "/sfkitcreate"
  
#--------------------------------------------------------------------GAME-END#
                  
on death of player:
 
    if {sfjoin.%player%} is true:
  
        remove 1 from {sf.players}
      
        if {sf.players} is 1:
          
            teleport {sf::*} to {sf.hub}
            send "{@logo}&4%player% Has died!" to {sf::*}
            send "{@logo}&aThe other player wins!" to {sf::*}
            set {sf.join::*} to false
            set {sf.game} to false
            set {sf.players} to 0
            delete {sf::*}
            clear inventory of {sf::*} 
            heal the player
            execute console command "/mapreset"
            delete {minigame.arenaname.breakblocks::*}
            delete {minigame.arenaname.breaklocations::*}
            delete {minigame.arenaname.placeblocks::*}
            delete {minigame.arenaname.placelocations::*}
 
            set {_count} to 0
            loop 41 times:
                set slot {_count} of player to {inv.%player%::%{_count}%}
                add 1 to {_count}     
                  
#-------------------------------------------------------------------------#
  
on quit:
 
    if {sfjoin.%player%} is true:
  
        remove 1 from {sf.players}
      
        if {sf.players} is 1:
          
            teleport {sf::*} to {sf.hub}
            send "{@logo}&4%player% Has died!" to {sf::*}
            send "{@logo}&aThe other player wins!" to {sf::*}
            set {sf.join::*} to false
            set {sf.game} to false
            set {sf.players} to 0
            delete {sf::*}
            clear inventory of {sf::*} 
            heal the player
            execute console command "/mapresetx"
            delete {minigame.arenaname.breakblocks::*}
            delete {minigame.arenaname.breaklocations::*}
            delete {minigame.arenaname.placeblocks::*}
            delete {minigame.arenaname.placelocations::*}
 
            set {_count} to 0
            loop 41 times:
                set slot {_count} of player to {inv.%player%::%{_count}%}
                add 1 to {_count}     
  
on place:
 
    if {sfjoin.%player%} is true:
  
        if {sf.pb} is false:
      
            cancel event
 
on break:
 
    if {sfjoin.%player%} is true:
  
        if {sf.pb} is false:
      
            cancel event
 
on damage:
  
    if attacker is a player:
  
        if {sf.pvp} is false:
      
            cancel event
            message "&4You can't do that right now!" to attacker

on damage:

    if damage cause is fall:
    
        if {nodmg.%victim%} is set:
        
            cancel event


            
on first join:
  
    give player 1 arrow named "&9Create&8/&4Delete &bKits"
  
on break:
 
    if {sfjoin.%player%} is true:
        add type of event-block to {minigame.arenaname.breakblocks::*}
        add location of event-block to {minigame.arenaname.breaklocations::*}
 
on place:
 
    if {sfjoin.%player%} is true:
        add type of event-block to {minigame.arenaname.placeblocks::*}
        add location of event-block to {minigame.arenaname.placelocations::*}
 
command /mapreset:
 
    trigger:
        loop {minigame.arenaname.breakblocks::*}:
            wait 3 ticks
            loop {minigame.arenaname.breaklocations::*}:
                wait 3 ticks
                set {_loc} to loop-value-2
                set {_block} to "%loop-value-1%" parsed as item
                set block at {_loc} to {_block}
        loop {minigame.arenaname.placeblocks::*}:
            wait 3 ticks
            loop {minigame.arenaname.placelocations::*}:
                wait 3 ticks
                set {_loc} to "%loop-value-2%"
                set block at {_loc} to air 
              
        message "{@logo}&bYou reset the map!"
 
Ok thanks for the code I will test it when my friend comes on. The kits work which is good but when I join the game it dose not teleport me to the map. And I also just realized that you posted the code at 5:58 AM what were you doing up that early? You probably just live in a different country as me but still.
 
No this is right
You wil be teleported 20 seconds before the game starts.
The other time is waiting phase.

Yes I live in germany and there I posted it 11:58 AM
 
Last edited by a moderator:
Can I have it teleport you to the cages when you do the join command because in the hub I have a PVP arena and I don't want the player to be PVPed when they are waiting for the game to start. Or maybe I can have a lobby for every map IDK.
 
Then build anywhere a wait lobby and add this code
code_language.skript:
#Add at the join part
teleport the player to {sf.waitlobby}

#add to the /sgfcommand
if arg 2 is "waitlobby":
     set {sf.waitlobby.%arg-3%} to location of player
     message "You set the waitlobby for %arg-3% to your locatikn"
 
Ok it works but I had to change teleport the player to {sf.waitlobby} to teleport the player to {sf.waitlobby.%arg 2%}. When I was loking over the code for something I saw that you had "if arg 2 is 'simple':" What I was trying to do when I codded the main code is to have multiple maps in stead of just one and arg 2 would be where you put the map. What my first idea was to have multiple games running at the same time which I think is to complected to do so only having like a few games running works to. I am not asking if you can set that up but if you want to that would be awesome.
 
I have much free time so
I will do that tomorow for you

If I understand it right you want to have multi world arena support right?
 
Yes. Thank you so much for the help. What I mean to clarify is that I would like it so I am have multiple maps instead of just the one simple map. Right now say me and my friend were playing a match then my other friend did the command to join right now it would say that that game is running. Is it possible to have it have a match run per map. I think that is what you men't by multi world areana but I was just making sure. Thanks again for the help I would be happy to put your name and YoshYZ in some kind of credits that I will make later.
 
Updated code
code_language.skript:
options:
    logo: &8[&9Sky&3Fight&8]
 
#--------------------------------------#
 
variables:
 
    {sf.game} = false
    {sf.world} = false
    {sf.players} = 0
    {sf.pb} = false
    {sfjoin.%player%} = false
    {sf.delay} = false
    {sf.enter} = false
    {sf.amount} = true
    {sf.pvp} = false



  
#-----------------------------------LEAVE-COMMAND#
 
command /leave:
    trigger:
        if {sfjoin.%player%} is true:
        
            if {sf.game.%{map.%player%}%} is true:
                clear {sf%{map.%player%}%::*}'s inventory
                teleport {sf%{map.%player%}%::*} to {sf.hub}
                set {sf.game.%{map.%player%}%} to false
                set {sf.world} to false
                set {player.%{map.%player%}%} to 0
                set {sf.pb} to false
                set {sf.delay} to false
                set {_mapsign} to "%{map.%player%}%"
                loop {signlocations::*}:
                    set line 2 of block at loop-value to "&f%{player.%{_mapsign}%}%&7/&f%{maxplayer.%{_mapsign}%}%"
                loop {signlocations::*}:
                    if line 3 of block at loop-value contains "%{map.%player%}%":
                       set line 4 of block at loop-value to "&7<< &aWaiting &7>>"
                       set {status.%{map.%player%}%} to "&7<< &aWaiting &7>>"
                set {sfjoin.%player%} to false
                message "{@logo}&4You left the game!"
                delete {sf%{map.%player%}%::*}
                execute console command "/mapreset"
                delete {map.%player%}
                delete {minigame.arenaname.breakblocks::*}
                delete {minigame.arenaname.breaklocations::*}
                delete {minigame.arenaname.placeblocks::*}
                delete {minigame.arenaname.placelocations::*}
            
                set {_count} to 0
                loop 41 times:
                    set slot {_count} of player to {inv.%player%::%{_count}%}
                    add 1 to {_count}
        
            else:
        
                set {sf.game.%{map.%player%}%} to false
                set {sf.world} to false
                set {player.%{map.%player%}%} to 0
                set {sf.pb} to false
                set {sfjoin.%player%} to false
                message "{@logo}&4You left the game!"
                clear the player's inventory
                teleport the player to {sf.hub}
                delete {sf%{map.%player%}%::*}
                set {_mapsign} to "%{map.%player%}%"
                loop {signlocations::*}:
                    set line 2 of block at loop-value to "&f%{player.%{_mapsign}%}%&7/&f%{maxplayer.%{_mapsign}%}%"
                loop {signlocations::*}:
                    if line 3 of block at loop-value contains "%{map.%player%}%":
                       set line 4 of block at loop-value to "&7<< &aWaiting &7>>"
                       set {status.%{map.%player%}%} to "&7<< &aWaiting &7>>"
                execute console command "/mapreset"
                delete {map.%player%}
                delete {minigame.arenaname.breakblocks::*}
                delete {minigame.arenaname.breaklocations::*}
                delete {minigame.arenaname.placeblocks::*}
                delete {minigame.arenaname.placelocations::*}
            
                set {_count} to 0
                loop 41 times:
                    set slot {_count} of player to {inv.%player%::%{_count}%}
                    add 1 to {_count}
        
        else:
        
            message "{@logo}&4You are not in a game!"
 
#----------------------------MAIN-COMMAND#
 
command /sf <text> <text> [<text>] [<text>]:
    usage: &9/&3sf "&2join&9" "&bmap&9" "&amode&9"
    trigger:
#------------------------------ADMIN-COMMAND#
        if arg 1 is "admin":
    
            if player has permission "sf.admin":
        
                if arg 2 is "sethub":
            
                    set {sf.hub} to location of player
                    message "{@logo}&bYou set the hub!"
            
                if arg 2 is "waitlobby":
            
                    set {sf.waitlobby.%arg-3%} to location of player
                    message "{@logo}&bYou set waitlobby for %arg-3% to your location!"
        
        
                if arg 2 is "remake":
                
                    loop {sf.%world%.breakblocks::*}:
                        loop {sf.%world%.breaklocations::*}:
                            set {_loc} to loop-value-2
                            set block at {_loc} to {sf.%world%.breakblocks::%loop-index-2%}
                if arg 2 is "setcages":
                  
                    if arg 3 is set:
                  
                        set {sf.cagespawn%arg-4%.%arg-3%} to location of player
                        message "{@logo}&bYou set cage spawn %arg-4% for %arg 3%!"
                if arg 2 is "addsign":
                    add location of targeted block to {signlocations::*}
                    message "{@logo}&bYou added the targted sign!"
            else:
                message "&4You are not a admin!"
        
#---------------------------------------------NORMAL-COMMAND#
 
        if arg 1 is "join":
            
            if arg 2 is set:

                if {sfjoin.%player%} is true:
                                
                    message "&4You are already in a game!"
                else: 
                    if {sf.game.%arg-2%} is true:
                                        
                        message "&4That game has already started!"
                    else: 
                        if {sf.delay} is true:
                                                
                            message "&4That game needs to cool down!"
                        else:                         
                            if {sf.world} is true:
                                              
                                message "&4That game needs to restart!"
                            else:                 
                                if {sfjoin.%player%} is false:
                                                                                    
                                    execute console command "/day day simple"
                                    teleport the player to {sf.waitlobby.%arg-2%}                                     
                                    set {_count} to 0
                                    loop 41 times:
                                        set {inv.%player%::%{_count}%} to slot {_count} of player
                                        add 1 to {_count}
                                                                                            
                                    clear the player's inventory
                                    add player to {sf%arg-2%::*}
                                    set {map.%player%} to "%arg-2%"
                                    add 1 to {player.%{map.%player%}%}
                                    set {_mapsign} to "%{map.%player%}%"
                                    loop {signlocations::*}:
                                        set line 2 of block at loop-value to "&f%{player.%{_mapsign}%}%&7/&f%{maxplayer.%{_mapsign}%}%"
                                    send "{@logo}&b%player% Joined the game!" to {sf%arg-2%::*}
                                    set player's gamemode to survival
                                    give player nether star named "&bKits"
                                    set {sfjoin.%player%} to true
                                    set {sf.pb} to false
        
    #----------------------------------------------------------------GAME-START#
                    
                                    if {player.%{map.%player%}%} is 2:
                                    
                                        wait 10 ticks
                                    
                                        set {sf.game.%{map.%player%}%} to true
                                        loop {signlocations::*}:
                                            if line 3 of block at loop-value contains "%{map.%player%}%":
                                                set line 4 of block at loop-value to "&7<< &cRunning &7>>"
                                                set {status.%{map.%player%}%} to "&7<< &cRunning &7>>"
                                        set {sf.pvp} to false
                                                  
                                        loop {sf%arg-2%::*}:
                                            teleport loop-value to {sf.cagespawn%loop-index%.%{map.%loop-value%}%}
                                          
                                        send "{@logo}&bThe game is starting in 20 seconds!" to {sf%arg-2%::*}
                                                            
                                        wait 10 seconds
                                        send "{@logo}&b10 seconds till the game starts" to {sf%arg-2%::*}
                                                            
                                        wait 5 seconds
                                        send "{@logo}&b5!" to {sf%arg-2%::*}
                                                            
                                        wait 1 second
                                        send "{@logo}&b4!" to {sf%arg-2%::*}
                                                            
                                        wait 1 second
                                        send "{@logo}&b3!" to {sf%arg-2%::*}
                                                            
                                        wait 1 second
                                        send "{@logo}&b2!" to {sf%arg-2%::*}
                                                            
                                        wait 1 second
                                        send "{@logo}&b1!" to {sf%arg-2%::*}
                                                  
                                        loop {sf%arg-2%::*}:
                                            set block under loop-value to air
                                        set {nodmg.%player%} to true
                                        wait 3 seconds
                                        delete {nodmg.%player%}
                                        wait 1 second
                                        send "{@logo}&bGO!" to {sf%arg-2%::*}
                                                        
                                        set {sf.pb} to true
                                                        
                                        remove 1 nether star from the inventory of {sf%arg-2%::*}
                                                            
                                        send "{@logo}&bIn 5 minutes you will be allowed to fight!" to {sf%arg-2%::*}
                                                        
                                        wait 3 minutes
                                        send "{@logo}&bIn 2 minutes you will be allowed to fight!" to {sf%arg-2%::*}
                                                            
                                        wait 2 minutes
                                        send "{@logo}&bTHE PVP GODS ARE TAKING A NAP! THERE ARE NO RULES!" to {sf%arg-2%::*}
                                        set {sf.pvp} to true
 
#------------------------------------------------------KITS#
 
 
 
command /sfkit [<text>] [<number>]:
 
    trigger:
        
        if arg 1 is "create":     
    
            if arg 2 is set:
        
                wait 2 ticks
                message "{@logo}&bKit %arg 2% Created!"
            
                loop all items in player's inventory: 
            
                    add loop-item to {sfkit-%arg-2%.%player%::*}
                
        if arg 1 is "delete":
    
            if arg 2 is set:
        
                message "{@logo}&bKit %arg 2% Deleted!"
                clear {sfkit-%arg-2%.%player%::*}
            
        if arg 1 is "use":
    
            if arg 2 is set:
        
                if {sfjoin.%player%} is true:
            
                    message "{@logo}&bKit %arg 2% Loaded!"
                    clear the player's inventory
                    give player nether star named "&4Kits"
                
                    loop {sfkit-%arg-2%.%player%::*}:
                
                        add loop-value to the player's inventory
 
on rightclick holding nether star:
 
    if {sfjoin.%player%} is true:
 
        open chest with 1 rows named "&4Kits" to player
    
        wait 1 tick
    
        if {sfkit-1.%player%::*} is set:
    
            format slot 0 of player with iron ingot named "&8Iron" to close then run [make player execute command "/sfkit use 1"]
        
        if {sfkit-2.%player%::*} is set:
    
            format slot 1 of player with gold ingot named "&eGold" to close then run [make player execute command "/sfkit use 2"]
        
        if {sfkit-3.%player%::*} is set:
    
            format slot 2 of player with diamond named "&bDiamond" to close then run [make player execute command "/sfkit use 3"]
 
#-----------------------------------------------------------------KIT-OPTIONS#
        
command /sfkitdelete:
 
    trigger:
 
        wait 2 ticks
 
        if {sfjoin.%player%} is false:
    
            open chest with 1 rows named "&4Delete Kits" to player
        
            wait 1 tick
        
            if {sfkit-1.%player%::*} is set:
        
                format slot 0 of player with iron ingot named "&8Delete Kit Iron" to close then run [make player execute command "/sfkit delete 1"]
            
            if {sfkit-2.%player%::*} is set:
        
                format slot 1 of player with gold ingot named "&eDelete Kit Gold" to close then run [make player execute command "/sfkit delete 2"]
            
            if {sfkit-3.%player%::*} is set:
        
                format slot 2 of player with diamond named "&bDelete Kit Diamond" to close then run [make player execute command "/sfkit delete 3"]
 
            format slot 8 of player with nether star named "&9Create" to close then run [make player execute command "/sfkitcreate"]
 
command /sfkitcreate:
 
    trigger:
    
        wait 2 ticks
    
        if {sfjoin.%player%} is false:
    
            open chest with 1 rows named "&9Create Kits" to player
    
            wait 1 tick
    
            if {sfkit-1.%player%::*} is not set:
    
                format slot 0 of player with iron ingot named "&8Create Kit Iron" to close then run [make player execute command "/sfkit create 1"]
            
            if {sfkit-2.%player%::*} is not set:
    
                format slot 1 of player with gold ingot named "&eCreate Kit Gold" to close then run [make player execute command "/sfkit create 2"]
 
            if {sfkit-3.%player%::*} is not set:
    
                format slot 2 of player with diamond named "&bCreate Kit Diamond" to close then run [make player execute command "/sfkit create 3"]
 
            format slot 8 of player with barrier named "&4Delete" to close then run [make player execute command "/sfkitdelete"]
 
on rightclick holding arrow:
 
    make player execute command "/sfkitcreate"
 
#--------------------------------------------------------------------GAME-END#
                
on death of player:
 
    if {sfjoin.%player%} is true:
 
        remove 1 from {player.%{map.%player%}%}
    
        if {player.%{map.%player%}%} is 1:
        
            teleport {sf%{map.%player%}%::*} to {sf.hub}
            send "{@logo}&4%player% Has died!" to {sf%{map.%player%}%::*}
            send "{@logo}&aThe other player wins!" to {sf%{map.%player%}%::*}
            set {sfjoin.%player%} to false
            set {sf.game.%{map.%player%}%} to false
            loop {signlocations::*}:
                if line 3 of block at loop-value contains "%{map.%player%}%":
                    set line 4 of block at loop-value to "&7<< &aWaiting &7>>"
                    set {status.%{map.%player%}%} to "&7<< &aWaiting &7>>"
            set {player.%{map.%player%}%} to 0
            delete {sf%{map.%player%}%::*}
            clear inventory of {sf%{map.%player%}%::*}
            heal the player
            set {_mapsign} to "%{map.%player%}%"
            loop {signlocations::*}:
                set line 2 of block at loop-value to "&f%{player.%{_mapsign}%}%&7/&f%{maxplayer.%{_mapsign}%}%"
            execute console command "/mapreset"
            delete {minigame.arenaname.breakblocks::*}
            delete {minigame.arenaname.breaklocations::*}
            delete {minigame.arenaname.placeblocks::*}
            delete {minigame.arenaname.placelocations::*}
 
            set {_count} to 0
            loop 41 times:
                set slot {_count} of player to {inv.%player%::%{_count}%}
                add 1 to {_count}   
                
#-------------------------------------------------------------------------#
 
on quit:
 
    if {sfjoin.%player%} is true:
 
        remove 1 from {player.%{map.%player%}%}
    
        if {player.%{map.%player%}%} is 1:
        
            teleport {sf%{map.%player%}%::*} to {sf.hub}
            send "{@logo}&4%player% Has died!" to {sf%{map.%player%}%::*}
            send "{@logo}&aThe other player wins!" to {sf%{map.%player%}%::*}
            set {sfjoin.%player%} to false
            set {sf.game.%{map.%player%}%} to false
            loop {signlocations::*}:
                if line 3 of block at loop-value contains "%{map.%player%}%":
                    set line 4 of block at loop-value to "&7<< &aWaiting &7>>"
                    set {status.%{map.%player%}%} to "&7<< &aWaiting &7>>"
            set {player.%{map.%player%}%} to 0
            delete {sf%{map.%player%}%::*}
            clear inventory of {sf%{map.%player%}%::*}
            heal the player
            set {_mapsign} to "%{map.%player%}%"
            loop {signlocations::*}:
                set line 2 of block at loop-value to "&f%{player.%{_mapsign}%}%&7/&f%{maxplayer.%{_mapsign}%}%"
            execute console command "/mapresetx"
            delete {minigame.arenaname.breakblocks::*}
            delete {minigame.arenaname.breaklocations::*}
            delete {minigame.arenaname.placeblocks::*}
            delete {minigame.arenaname.placelocations::*}
 
            set {_count} to 0
            loop 41 times:
                set slot {_count} of player to {inv.%player%::%{_count}%}
                add 1 to {_count}   
 
on place:
 
    if {sfjoin.%player%} is true:
 
        if {sf.pb} is false:
    
            cancel event
 
on break:
 
    if {sfjoin.%player%} is true:
 
        if {sf.pb} is false:
    
            cancel event
 
on damage:
 
    if attacker is a player:
 
        if {sf.pvp} is false:
    
            cancel event
            message "&4You can't do that right now!" to attacker

on damage:

    if damage cause is fall:
  
        if {nodmg.%victim%} is set:
      
            cancel event


          
on first join:
 
    give player 1 arrow named "&9Create&8/&4Delete &bKits"
 
on break:
 
    if {sfjoin.%player%} is true:
        add type of event-block to {minigame.arenaname.breakblocks::*}
        add location of event-block to {minigame.arenaname.breaklocations::*}
 
on place:
 
    if {sfjoin.%player%} is true:
        add type of event-block to {minigame.arenaname.placeblocks::*}
        add location of event-block to {minigame.arenaname.placelocations::*}
 
command /mapreset:
 
    trigger:
        loop {minigame.arenaname.breakblocks::*}:
            wait 3 ticks
            loop {minigame.arenaname.breaklocations::*}:
                wait 3 ticks
                set {_loc} to loop-value-2
                set {_block} to "%loop-value-1%" parsed as item
                set block at {_loc} to {_block}
        loop {minigame.arenaname.placeblocks::*}:
            wait 3 ticks
            loop {minigame.arenaname.placelocations::*}:
                wait 3 ticks
                set {_loc} to "%loop-value-2%"
                set block at {_loc} to air
            
        message "{@logo}&bYou reset the map!"
      
on right click on sign:
    if line 1 of clicked block is "{@logo}":
        set {_map} to "%uncolored line 3 of block%"
        set {_var::*} to split {_map} at "-"
        set {_maps} to "%{_var::2}%"
        replace all " " in {_maps} with ""
        make player execute command "/sf join %{_maps}%"
      
on sign change:
    if player has permission "skyfights.joinsign":
        if line 1 of block is "SkyFight": 
            if line 2 of block is "Join" or "join":
                set {_mapsign} to "%line 3 of block%"
                if {status.%line 3 of block%} is not set:
                    set {status.%line 3 of block%} to "&7<< &aWaiting&7 >>"
                if {player.%{_mapsign}%} is not set:
                    set {player.%{_mapsign}%} to 0
                if {maxplayer.%{_mapsign}%} is not set:
                    set {maxplayer.%{_mapsign}%} to 8
                set line 1 of block to "{@logo}"
                set line 4 of block to "%{status.%line 3 of block%}%"
                set line 3 of block to "&7Join &7- &b%{_mapsign}%"
                set line 2 of block to "&f%{player.%{_mapsign}%}%&7/&f%{maxplayer.%{_mapsign}%}%"
 
Last edited by a moderator:
When I ran the code I got 39 error's. If you need me to send them to you I will figure some way to.
[doublepost=1492256738,1492256571][/doublepost]Oh sorry it was just me I forgot to copy the options at the start so every thing with {@logo} glitched out I will fix that.
 
Status
Not open for further replies.