#prestige

1 messages · Page 1 of 1 (latest)

twilit hill
#

I am trying to make a gui system with a prestige thing. I want it to need certain items to prestige and give a sunflower renamed to prestige token when you prestige. is this possible?

wild creek
twilit hill
#

ok ty

wild creek
#
command /prestige:
    trigger:
        open chest inventory with 3 rows named "Prestige:" to player
        set slot 4 of player's current inventory to paper named "&7⬇ You must place &fx4 &7of &ePrestige Star &7⬇"
        set slot (all integers between 0 and 26 where [input isn't 4 or 13]) of player's current inventory to gray stained glass pane named " "
        give 8 nether star named "&ePrestige Star" with nbt "{prestigeStar:true}" to player


on inventory click:
    event-inventory's name is "Prestige:"
    if event-slot's index != 13:
        cancel event
        stop
    player's cursor slot's type != air
    wait 1 tick
    (tag "prestigeStar" of nbt compound of event-slot) is set
    stop if event-slot's item amount < 4
    if event-slot's item amount = 4:
        set event-slot to air
    else:
        remove 4 from event-slot's item amount
    send "&aPrestige!" to player
    give sunflower of unbreaking with all flags hidden named "&ePretige Token" with nbt "{pretigeToken:true}" to player
#

Here you have a small example.

twilit hill
#

in this case

#

i would get the nether stars with the prestige name and puit it there

#

?

wild creek
#

Not the name, in this case I recommend you use the nbt as I show you in the example

#

And in this way, you set that value to nbt when you give the required object.

twilit hill
#

what is an nbt

#

?

#

sorry im very new to skripting

wild creek
#

np

#

I wouldn't know how to explain it, but in summary it is the internal data of each object/entity... in the case of entities you can't add custom nbt, in the case of objects you can, and that helps you to add an additional layer of " security" at certain events.

#

https://github.com/ShaneBeee/SkBee/wiki
Also, to learn more about it, I recommend you to read the skbee documentation, although believe me it's not that difficult to understand...

GitHub

SkBee is a Skript addon that aims to add more useful elements to Skript. - ShaneBeee/SkBee

twilit hill
#

so how would i get the item for the prestige

wild creek
#

Before I answer that, do you get the prestige item through an external plugin? or skript?

#

In case you get it with skript, send me your code.

#

In case you get it with an external plugin, use the following code to get all your nbt:

command /getNBT:
    trigger:
        player's tool != air
        send player's tool's nbt

and when you receive it send me a print

twilit hill
#

i dont have code thats the issue im tryna make one but i just started

#

i have only made like at the most a 10 line code before

#

im tryna make it in skript

wild creek
#

Give me a moment and I'll give you a simple example, it will be just an example... you shouldn't use it in your final version

twilit hill
#

ok

wild creek
#

This would be a simple example.

options:
    requiredItems: 4 #Amount of required items!


command /prestige [<text>]:
    trigger:
        if arg-1 is "get-item":
            give 64 of nether star named "&e&lPrestige Star&r" with nbt "{prestigeTool:true}" to player
            send "You got &ex64 &fprestige stars!"
            stop
        open chest inventory with 4 rows named "Prestige GUI:" to player
        set slot 13 of player's current inventory to player skull with nbt "{SkullOwner:{Id:""faa66c0d-8855-4ebb-8e6a-47fb771f874c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDFiNjJkYjVjMGEzZmExZWY0NDFiZjcwNDRmNTExYmU1OGJlZGY5YjY3MzE4NTNlNTBjZTkwY2Q0NGZiNjkifX19""}]}}}" named "&7Place &ex{@requiredItems} &7of required item!"
        set slot (all integers between 0 and 35 where [input != 13 or 22]) of player's current inventory to gray stained glass pane named "&7◆"


on inventory click:
    event-inventory's name is "Prestige GUI:"
    if event-slot's index != 22:
        cancel event
        stop
    player's cursor slot's type != air
    wait 1 tick
    (tag "prestigeTool" of nbt compound of event-slot) is set
    stop if event-slot's item amount < {@requiredItems}
    set {_a} to rounded down (event-slot's item amount / {@requiredItems})
    set {_r} to rounded down ({_a} * {@requiredItems})
    if event-slot's item amount - {_r} <= 0:
        set event-slot to air
    else:
        remove {_r} from event-slot's item amount
    give {_a} of sunflower named "&6&lPrestige Token&r" with nbt "{prestigeToken:true}" to player
    send "You got &ex%{_a}% &fprestige token(s)!"
twilit hill
#

do i add that to the end of the last one u sent

wild creek
#

Replace all the code that I'm sending you with this new one, and try it... but I remind you that it's just an example, I don't recommend using it as it is.

twilit hill
#

ok thank you!

#

but 1 thing

#

i get this

wild creek
#

Which version are you using?

twilit hill
#

1.17

#

.1

wild creek
twilit hill
#

and it also did not give me the prestige stars

wild creek
#

Of course, possibly the id is different, try to use an id of your version, any object is valid.

twilit hill
#

ok

#

ok ty

#

i had one more question

#

its not on the same topic

#

I have another skript

#

on mine:
if player's gamemode is not creative:
if player has permission "block.tp":
give drops of event-block using player's tool to player
cancel drops

#

this is for an autopickup skript but i was wondering if there is a way to make stuff like stone and wood also have fortune

#

the fortune works for iron and stuff like that tho

wild creek