#gui

1 messages · Page 1 of 1 (latest)

stray thicket
#

anyoen cna help???

azure hill
#

You have a lot of options how to create a gui, but my recommendation is to use skript vanilla gui

here is an example:

    set {_gui} to a new chest inventory with 6 row with name "Example"
    set slot 34 of {_gui} to dirt 
    open {_gui} to {_p}```
stray thicket
#

but how do i call the funcion

azure hill
#

this function?

    trigger:
        exampleMenu(player)
stray thicket
#

yes

#

@azure hill how do i do it so i can click on the dirt block and it willopen an new gui

#

and so you there are like glass panes that you cant click

azure hill
# stray thicket <@670375448508629012> how do i do it so i can click on the dirt block and it wil...

well we need a new event called
on inventory click

this is an example

on inventory click:
    if name of event-inventory is "Example": 
    #here you write the inventory
        if event-inventory is player's inventory: 
        #this just check if clicked slot is not in players inventory
            stop 
        cancel event 
        #this makes the player not able to move items
        if clicked slot is 34: 
        # this check the clicked slot in the inventory player has open
#

@stray thicket ^

stray thicket
#

ty

azure hill
stray thicket
#

its working thanks

#

wait @azure hill how do i do it so i can call a function when i click on the dirt

stray thicket
#

why is this not working

if clicked slot is 3: pet-shop(player)

#

@azure hill

stray thicket
azure hill
stray thicket
#

``on inventory click:
if name of event-inventory is "&6Shop":

    if event-inventory is player's inventory: 
    
        stop 
    cancel event 
  
    if clicked slot is 3:
        pet-shop(player)

on inventory click:
if name of event-inventory is "&5Pet Shop":

    if event-inventory is player's inventory: 
    
        stop 
    cancel event 

command /shop [<text>]:
trigger:
shop(player)

function shop(p: player):
set {_gui} to a new chest inventory with 1 row with name "&6Shop"

set slot 0 of {_gui} to black glass pane named "&6" 
set slot 1 of {_gui} to black glass pane named "&6" 
set slot 2 of {_gui} to black glass pane named "&6" 
set slot 3 of {_gui} to wool named "&dPet Shop" 
set slot 4 of {_gui} to black glass pane named "&6" 
set slot 5 of {_gui} to black glass pane named "&6" 
set slot 6 of {_gui} to black glass pane named "&6" 
set slot 7 of {_gui} to black glass pane named "&6" 
set slot 8 of {_gui} to black glass pane named "&6" 
set slot 9 of {_gui} to black glass pane named "&6" 

open {_gui} to {_p}

function pet-shop(p: player):
set {_gui} to a new chest inventory with 1 row with name "&5Pet Shop"

set slot 0 of {_gui} to black glass pane named "&6" 
set slot 1 of {_gui} to black glass pane named "&6" 
set slot 2 of {_gui} to black glass pane named "&6" 
set slot 3 of {_gui} to wool named "&6Zaddy" 
set slot 4 of {_gui} to black glass pane named "&6" 
set slot 5 of {_gui} to black glass pane named "&6" 
set slot 6 of {_gui} to black glass pane named "&6" 
set slot 7 of {_gui} to black glass pane named "&6" 
set slot 8 of {_gui} to black glass pane named "&6" 
set slot 9 of {_gui} to black glass pane named "&6" 

open {_gui} to {_p}

``

azure hill
stray thicket
#

like i wanna do it so i can click on the pink wool and then it will like open a new gui (i tryied to Make it by myself but its not working)

azure hill
#

@autumn plover

stray thicket
#

so, can you modify the code so i can click on the pik wool and then like its opens a new gui

azure hill
#

there is no pink wool in your code

stray thicket
#

wait

#

now real code

``on inventory click:
if name of event-inventory is "&6Shop":

    if event-inventory is player's inventory: 
    
        stop 
    cancel event 
  
    if clicked slot is 3:
        pet-shop(player)

on inventory click:
if name of event-inventory is "&5Pet Shop":

    if event-inventory is player's inventory: 
    
        stop 
    cancel event 

command /shop [<text>]:
trigger:
shop(player)

function shop(p: player):
set {_gui} to a new chest inventory with 1 row with name "&6Shop"

set slot 0 of {_gui} to black glass pane named "&6" 
set slot 1 of {_gui} to black glass pane named "&6" 
set slot 2 of {_gui} to black glass pane named "&6" 
set slot 3 of {_gui} to pink wool named "&dPet Shop" 
set slot 4 of {_gui} to black glass pane named "&6" 
set slot 5 of {_gui} to black glass pane named "&6" 
set slot 6 of {_gui} to black glass pane named "&6" 
set slot 7 of {_gui} to black glass pane named "&6" 
set slot 8 of {_gui} to black glass pane named "&6" 
set slot 9 of {_gui} to black glass pane named "&6" 

open {_gui} to {_p}

function pet-shop(p: player):
set {_gui} to a new chest inventory with 1 row with name "&5Pet Shop"

set slot 0 of {_gui} to black glass pane named "&6" 
set slot 1 of {_gui} to black glass pane named "&6" 
set slot 2 of {_gui} to black glass pane named "&6" 
set slot 3 of {_gui} to wool named "&6Zaddy" 
set slot 4 of {_gui} to black glass pane named "&6" 
set slot 5 of {_gui} to black glass pane named "&6" 
set slot 6 of {_gui} to black glass pane named "&6" 
set slot 7 of {_gui} to black glass pane named "&6" 
set slot 8 of {_gui} to black glass pane named "&6" 
set slot 9 of {_gui} to black glass pane named "&6" 

open {_gui} to {_p}

``

#

with pink wool

azure hill
stray thicket
azure hill
#

3 not 2

#

3 of this `

stray thicket
#

this?

azure hill
#

yes

stray thicket
#
    if name of event-inventory is "&6Shop": 
 

        if event-inventory is player's inventory: 
        
            stop 
        cancel event 
      
        if clicked slot is 3:
            pet-shop(player)


on inventory click:
    if name of event-inventory is "&5Pet Shop": 
 

        if event-inventory is player's inventory: 
        
            stop 
        cancel event 
      
           


command /shop [<text>]:
    trigger:
        shop(player)


function shop(p: player): 
    set {_gui} to a new chest inventory with 1 row with name "&6Shop"

    set slot 0 of {_gui} to black glass pane named "&6" 
    set slot 1 of {_gui} to black glass pane named "&6" 
    set slot 2 of {_gui} to black glass pane named "&6" 
    set slot 3 of {_gui} to pink wool named "&dPet Shop" 
    set slot 4 of {_gui} to black glass pane named "&6" 
    set slot 5 of {_gui} to black glass pane named "&6" 
    set slot 6 of {_gui} to black glass pane named "&6" 
    set slot 7 of {_gui} to black glass pane named "&6" 
    set slot 8 of {_gui} to black glass pane named "&6" 
    set slot 9 of {_gui} to black glass pane named "&6" 
    
    open {_gui} to {_p}



function pet-shop(p: player): 
    set {_gui} to a new chest inventory with 1 row with name "&5Pet Shop"

    set slot 0 of {_gui} to black glass pane named "&6" 
    set slot 1 of {_gui} to black glass pane named "&6" 
    set slot 2 of {_gui} to black glass pane named "&6" 
    set slot 3 of {_gui} to wool named "&6Zaddy" 
    set slot 4 of {_gui} to black glass pane named "&6" 
    set slot 5 of {_gui} to black glass pane named "&6" 
    set slot 6 of {_gui} to black glass pane named "&6" 
    set slot 7 of {_gui} to black glass pane named "&6" 
    set slot 8 of {_gui} to black glass pane named "&6" 
    set slot 9 of {_gui} to black glass pane named "&6" 
    
    open {_gui} to {_p}

#

this?

azure hill
#

see what you did wrong

#

?

stray thicket
#

no ?!?

azure hill
#

this works

stray thicket
#

wait what is this vscode addon so you like color the code

azure hill
#

just remove the -

stray thicket
#

wait what is this vscode addon so you like color the code

#
function pet-shop(p: player): 
    set {gui} to a new chest inventory with 1 row with name "&5Pet Shop"

    set slot 0 of {gui} to black glass pane named "&6" 
    set slot 1 of {gui} to black glass pane named "&6" 
    set slot 2 of {gui} to black glass pane named "&6" 
    set slot 3 of {gui} to wool named "&6Zaddy" 
    set slot 4 of {gui} to black glass pane named "&6" 
    set slot 5 of {gui} to black glass pane named "&6" 
    set slot 6 of {gui} to black glass pane named "&6" 
    set slot 7 of {gui} to black glass pane named "&6" 
    set slot 8 of {gui} to black glass pane named "&6" 
    set slot 9 of {gui} to black glass pane named "&6" 
    
    open {gui} to {p}```

LIKE THIS?
azure hill
#

no

#

this is so wrong

#

you removed the local variables
function pet-shop(p: player):
to
function petshop(p: player):

#

@stray thicket

stray thicket
#

wait

#

ok

#

wait what is this vscode addon so you like color the code

azure hill
#

wait

#

Name: Skript + SkriptInsight
Id: NickAc.skriptinsight
Description: Add Skript support for VSCode
Version: 0.0.1
Publisher: NickAc
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=NickAc.skriptinsight

Name: Trailing Spaces
Id: shardulm94.trailing-spaces
Description: Highlight trailing spaces and delete them in a flash!
Version: 0.4.1
Publisher: Shardul Mahadik
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=shardulm94.trailing-spaces

Name: intelliskript
Id: JohnHeikens.intelliskript
Description: IntelliSense for skript
Version: 1.7.1
Publisher: John Heikens
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=JohnHeikens.intelliskript

#

these 3 @stray thicket

stray thicket
#

why is there everywhere red

azure hill
#

do save the file and they should be removed

stray thicket
#

i have

azure hill
stray thicket
#

ok

azure hill
#

btw you didn't fix your problem yet

#

you should learn how to read an error

stray thicket
#

why?

azure hill
#

do /sk reload "your file"

#

and send the error you got

stray thicket
#

i have fix

azure hill
#

oh ok

stray thicket
azure hill
#

👍