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.

WimpyLlama

Member
Apr 8, 2017
26
0
0
20
So I am not one of those kids that's is like oh I wan't to make a mini game even know I have no clue how to use skript. I am advanced at skript but I am trying to make a big mini game and my problem right now is I want to set up a system to save your inventory at the start of the game and then when the game ends it gives you the inventory back. I have a on death event that ends the game but I don't know how I would have it save the inventory of 4 players then give it back. Please help me with this because if It dose not save the inventory the mini game would not work like I need it to. If you need more information on the mini game in order to help I would be happy to. I use skript and SKQurey.
 
If you are advanced at skript as you said , you should do that easly.
  • Loop player's inventory
  • Add loop items into a variable list
  • Loop the variable list
  • Add loop item to the player's inventory
 
Ok I am advanced at skript but the only thing I am not good at and hate is loops. If I could just have a bit of help with it I know a lot about skript but as I said loops are my worst enemy.
[doublepost=1491661291,1491660104][/doublepost]Never mind I found a different thread that fixed my problems and it works. Thanks for the help.
 
code_language.skript:
loop all items in player's inventory:
    add loop-item to {inventory::%player%::*}
code_language.skript:
loop {inventory::%player%::*}:
    add loop-value to the player's inventory
 
Thanks! That code is at lot smaller than the one I was using.
[doublepost=1491665265,1491665210][/doublepost]I know you probably won't know how to do this and I am fine with it but is there a way to place a schematic or copy and paste a world in skript?
[doublepost=1491665297][/doublepost]If I need to get a addon I can.
 
In the past PirateSk was created just to do all this things , but now it's not longer supported.

Now skStuff has the sintax to do that.
Link: https://forums.skunity.com/resources/skstuff.131/

code_language.skript:
set {_session} to new edit session in player's world with limit -1 #-1 = inifinite

paste schematic "plugins/WorldEdit/schematics/InstantHouse1" below player using editsession {_session}
paste schem "%world of {_loc}%/building" at {_loc} using {_session} ignoring air
 
The mini game I am making uses a map that need to be reset. I am trying to find out a way to reset the map. I used to use multiverse but it was buggy and sometimes did not even do anything. So I just need a way to reset the map.
 
What kind of code would that be. I know I sound like I am less and less advanced at skript. By advanced I more men't that I know more than the average skripter but I am not a pro. It's like I am a semi pro.
 
What kind of code would that be. I know I sound like I am less and less advanced at skript. By advanced I more men't that I know more than the average skripter but I am not a pro. It's like I am a semi pro.
Is English your first language? (Sorry for me asking, I was just curious as to if you wanted to speak a different language as we have many different languages here)
 
code_language.skript:
on break:
    add type of event-block to {minigame.arenaname.breakblocks::*}
    add location of event-block to {minigame.arenaname.breaklocations::*}

Regeneration
code_language.skript:
loop {minigame.arenaname.breakblocks::*}:
    loop {minigame.arenaname.breaklocations::*}
        set {_loc} to loop-value-2
        set block at {_loc} to {minigame.arenaname.breakblocks::%loop-index-2%}
 
Thank You I put this in my skript and it worked. At first I got a error because you forgot the : at the end of loop {minigame.arenaname.breaklocations::*} but I found what the error was and fixed it so now it works. I know I am asking a lot but this is the last thing. But I am trying to set up a kit maker that will let you make kits in game you will be able to make up to 3 kits and it just won't work. This is my code.

if arg 1 is "kit":

if arg 2 is "create":

loop all items in player's inventory:
add loop-item to {sf.%arg 3%::%player%::*}

if {sf.kit.1.%player%} is arg 3:

if {sf.kit.2.%player%} is arg 3:

if {sf.kit.3.%player%} is not arg 3:

set {sf.kit.3.%player%} to arg 3

if {sf.kit.2.%player%} is not arg 3:

set {sf.kit.2.%player%} to arg 3

if {sf.kit.1.%player%} is not arg 3:

set {sf.kit.1.%player%} to arg 3

message "{@logo}&bKit %arg 3% &bmade!"

if arg 2 is "use":

wait 1 tick

clear the player's inventory

loop {sf.%arg 3%::%player%::*}:
add loop-value to the player's inventory

give player nether star named "&4Kits"

if arg 2 is "delete":

delete {sf.%arg 3%.%player%::*}

message "{@logo}&bYou deleted %arg 3%!"

on rightclick holding nether star:

if {sf.join::%player%} is true:

open chest with 3 rows named "&4Kits" to player

wait 1 tick

format slot 0 of player with dirt named "%{sf.kit.1.%player%}%" to close then run [make player execute command "/sf kit use %{sf.kit.1.%player%}%"]
format slot 1 of player with cobble named "%{sf.kit.2.%player%}%" to close then run [make player execute command "/sf kit use %{sf.kit.2.%player%}%"]
format slot 2 of player with iron ore named "%{sf.kit.3.%player%}%" to close then run [make player execute command "/sf kit use %{sf.kit.3.%player%}%"]
[doublepost=1491670692,1491670086][/doublepost]
code_language.skript:
        if arg 1 is "kit":

            if arg 2 is "create":
            
                loop all items in player's inventory:
                    add loop-item to {sf.%arg 3%::%player%::*}   
                
                if {sf.kit.1.%player%} is arg 3:
                
                    if {sf.kit.2.%player%} is arg 3:
                    
                        if {sf.kit.3.%player%} is not arg 3:
                        
                            set {sf.kit.3.%player%} to arg 3
                    
                    if {sf.kit.2.%player%} is not arg 3:
                    
                        set {sf.kit.2.%player%} to arg 3   
                    
                if {sf.kit.1.%player%} is not arg 3:
                
                    set {sf.kit.1.%player%} to arg 3
                
                message "{@logo}&bKit %arg 3% &bmade!"
        
            if arg 2 is "use":
            
                wait 1 tick
            
                clear the player's inventory
            
                loop {sf.%arg 3%::%player%::*}:
                    add loop-value to the player's inventory
                
                give player nether star named "&4Kits"
                
            if arg 2 is "delete":
                
                delete {sf.%arg 3%.%player%::*}
                
                message "{@logo}&bYou deleted %arg 3%!"
    
on rightclick holding nether star:

    if {sf.join::%player%} is true:
    
        open chest with 3 rows named "&4Kits" to player
        
        wait 1 tick
        
        format slot 0 of player with dirt named "%{sf.kit.1.%player%}%" to close then run [make player execute command "/sf kit use %{sf.kit.1.%player%}%"]
        format slot 1 of player with cobble named "%{sf.kit.2.%player%}%" to close then run [make player execute command "/sf kit use %{sf.kit.2.%player%}%"]
        format slot 2 of player with iron ore named "%{sf.kit.3.%player%}%" to close then run [make player execute command "/sf kit use %{sf.kit.3.%player%}%"]
 
That's a fast example
code_language.skript:
command /kit [<text>] [<number>]:
    trigger:
        if arg-1 is "create":
            if arg-2 is set:
                loop all items in player's inventory:
                    add loop-item to {sf.kit-%arg-2%::*}
                    message "Created."
        if arg-1 is "delete":
            if arg-2 is set:
                clear {sf.kit-%arg-2%::*}
                message "Deleted."
        if arg-1 is "use":
            if arg-2 is set:
                loop {sf.kit-%arg-2%::*}:
                    add loop-value to the player's inventory
                    message "Loaded."
 
Status
Not open for further replies.