Jump to content

Lootcrate skript request (Hard skript)


Evanbeer

Recommended Posts

I would like it to be if u do "/lootcrate open" it will open a gui chest and you can put items in it. (u need the permission permission.lootcrate)
when you right click a stick (i can change it myself) it wil give 3 random item out that gui chest.

If u can make this i would be sooo happy!
pls dm me on discord Evanbeer#0001 cuz i read my discord more often then the minehut forums.

Edited by Evanbeer
Link to comment
Share on other sites

  • Evanbeer changed the title to Lootcrate skript request

This is what i have: on right click:
            if name of player's tool is "&dLegendary Crate"
            remove 1 of tool from player's held item
function random(p: player):
    set {_random} to random integer between 1 and 2
    if {_random} is 1:
        send "&dYey! &fYou found diamond!" to {_p}
        give {_p} 1 diamond named "&6Gem
    if {_random} is 2:
        send "&dYey! &fYou found diamond!" to {_p}
        give {_p} 2 diamond named "&6Gem

But it will take the crate and dont give items
this are the errors:2021-08-14_09_19_38.thumb.png.e1ef30f9f098756498ca07b4278f1414.png

Edited by Evanbeer
Link to comment
Share on other sites

  • Evanbeer changed the title to Lootcrate skript request (Hard skript)

on right click:
    if name of player's tool is "&dLegendary Crate":
            remove 1 of tool from player's held item
            function random(p: player):
                set {_random} to random integer between 1 and 2
                if {_random} is 1:
                   send "&dYey! &fYou found diamond!" to {_p}
                   give {_p} 1 diamond named "&6Gem
                   if {_random} is 2:
                       send "&dYey! &fYou found diamond!" to {_p}
                       give {_p} 2 diamond named "&6Gem

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

Never mind try this:

 

on right click:
    if name of player's tool is "&dLegendary Crate":
            remove 1 of player's held item
            function random(p: player):
                set {_random} to random integer between 1 and 2
                if {_random} is 1:
                   send "&dYey! &fYou found diamond!" to {_p}
                   give {_p} 1 diamond named "&6Gem"
                   if {_random} is 2:
                       send "&dYey! &fYou found diamond!" to {_p}
                       give {_p} 2 diamond named "&6Gem"

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

On 8/13/2021 at 2:58 PM, Evanbeer said:

I would like it to be if u do "/lootcrate open" it will open a gui chest and you can put items in it. (u need the permission permission.lootcrate)
when you right click a stick (i can change it myself) it wil give 3 random item out that gui chest.

If u can make this i would be sooo happy!
pls dm me on discord Evanbeer#0001 cuz i read my discord more often then the minehut forums.

i am gonna test it

 

Link to comment
Share on other sites

2021-08-14_20_18_17.thumb.png.176747a133a7fde8b3464f9c3078ca3f.pngone error remaining but when i fix the error it won't even do this part anymore: on right click:
    if name of player's tool is "&dLegendary Crate":
        remove 1 of tool from player's held item 
It won't remove the item out the players hand

Edited by Evanbeer
Link to comment
Share on other sites

Try this:

on right click:
    if name of player's tool is "&dLegendary Crate":
        remove 1 of player's held item
        set {_random} to random integer between 1 and 2
        if {_random} is 1:
            send "&dYey! &fYou found diamond!" to player
            give player 1 diamond named "&6Gem"
            if {_random} is 2:
                send "&dYey! &fYou found diamond!" to player
                give player 2 diamond named "&6Gem"

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

With this skript, you cant wear it, and everything works!

 

on right click:
    if name of player's tool is "&dLegendary Crate":
        cancel event
        remove 1 of player's held item from player's inventory
        set {_random} to random integer between 1 and 2
        if {_random} is 1:
            send "&dYey! &fYou found diamond!" to player
            give player 1 diamond named "&6Gem"
            if {_random} is 2:
                send "&dYey! &fYou found diamond!" to player
                give player 2 diamond named "&6Gem"

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

This should work better!

 

on right click:
    if name of player's tool is "&dLegendary Crate":
        cancel event
        set {_random} to random integer between 1 and 2
        if {_random} is 1:
            send "&dYey! &fYou found diamond!" to player
            give player 1 diamond named "&6Gem"
            remove 1 of player's held item from player's inventory
            if {_random} is 2:
                send "&dYey! &fYou found 2 diamonds!" to player
                give player 2 diamond named "&6Gem"
                remove 1 of player's held item from player's inventory

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

Nevermind, ignore all the past skripts, this one is tested 100% to work.

 

on right click:
    if name of player's tool is "&dLegendary Crate":
        set {_random} to random integer between 1 and 2
        if {_random} is 1:
            send "&dYey! &fYou found diamond!" to player
            give player 1 diamond named "&6Gem"
            remove 1 of player's held item from player's inventory
        else:
            if {_random} is 2:
                send "&dYey! &fYou found 2 diamonds!" to player
                give player 2 diamond named "&6Gem"
                remove 1 of player's held item from player's inventory

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...