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

Petervpg

Member
Jul 27, 2017
18
0
0
20
So im making this gui for my prison server (The server is on 1.8.9). and my skript wont work.
This is my code that works:
code_language.skript:
Command /vs:
    trigger:
        open chest with 5 rows named "&2&lVagt Shop" to player
        wait 1 tick
        set slot 4 of player's current inventory to gold helmet named "&7&lC-Vagt Hjelm" with lore "&a&lKlik her &a| Hjelmen koster | &a100$"

command /test:
    trigger:
        make console execute command "/say test"
But when I add "to run" or "to close then run" it wont work
code_language.skript:
Command /vs:
    trigger:
        open chest with 5 rows named "&2&lVagt Shop" to player
        wait 1 tick
        set slot 4 of player's current inventory to gold helmet named "&7&lC-Vagt Hjelm" with lore "&a&lKlik her &a| Hjelmen koster | &a100$" to close then run [make player execute command "test"]

command /test:
    trigger:
        make console execute command "/say test"
and in game it just says "&a&lKlik her &a| Hjelmen koster | &a100$" to close then run [make player execute command "test"] is not a text
 
So im making this gui for my prison server (The server is on 1.8.9). and my skript wont work.
This is my code that works:
code_language.skript:
Command /vs:
    trigger:
        open chest with 5 rows named "&2&lVagt Shop" to player
        wait 1 tick
        set slot 4 of player's current inventory to gold helmet named "&7&lC-Vagt Hjelm" with lore "&a&lKlik her &a| Hjelmen koster | &a100$"

command /test:
    trigger:
        make console execute command "/say test"
But when I add "to run" or "to close then run" it wont work
code_language.skript:
Command /vs:
    trigger:
        open chest with 5 rows named "&2&lVagt Shop" to player
        wait 1 tick
        set slot 4 of player's current inventory to gold helmet named "&7&lC-Vagt Hjelm" with lore "&a&lKlik her &a| Hjelmen koster | &a100$" to close then run [make player execute command "test"]

command /test:
    trigger:
        make console execute command "/say test"
and in game it just says "&a&lKlik her &a| Hjelmen koster | &a100$" to close then run [make player execute command "test"] is not a text



code_language.skript:
Command /vs:
    trigger:
        open chest with 5 rows named "&2&lVagt Shop" to player
        wait 1 tick
        format slot 4 of player with gold helmet named  "&7&lC-Vagt Hjelm" with lore "&a&lKlik her &a| Hjelmen koster | &a100$" to close then run [make player execute command "test"]

command /test:
    trigger:
        make console execute command "/say test"

btw. Fedt at du er dansk :emoji_wink:
 
  • Like
Reactions: Petervpg
code_language.skript:
Command /vs:
    trigger:
        open chest with 5 rows named "&2&lVagt Shop" to player
        wait 1 tick
        format slot 4 of player with gold helmet named  "&7&lC-Vagt Hjelm" with lore "&a&lKlik her &a| Hjelmen koster | &a100$" to close then run [make player execute command "test"]

command /test:
    trigger:
        make console execute command "/say test"

btw. Fedt at du er dansk :emoji_wink:
Det virkede stadigvæk ikke for mig, den sagde bare det samme... at det ikke er en text
[doublepost=1529004457,1529004383][/doublepost]
I would suggest re-writing it to use TuSKe GUI manager
https://github.com/Tuke-Nuke/TuSKe/wiki/GUI-Manager
How does Tuske work tho?
 
just add this:

code_language.skript:
on inventory click:
    if name of current inventory of player is "&2&lVagt Shop":
        if clicked slot is 4:
            execute console command "/say you clicked"
 
Dident see that I could click the simple and advanced gui XD
Using TuSKe can be useful for you.

Example Code:
code_language.skript:
command /guiExample:
    trigger:
        open virtual chest inventory to player
        format gui slot 0 of player with stone named "It won't do anything"
        format gui slot 1 of player with stone named "It will just close" to close
        format gui slot 2 of player with stone named "It will just close but only with pressing a number key" to close using number key
        format gui slot 3 of player with stone named "It will make the player execute a command, but he might not have permission" to run player command "/gui"
        format gui slot 4 of player with stone named "It will make the player execute a command with ""*"" permission" to run player command "/gui" with permission "*"
        format gui slot 5 of player with stone named "It will make the console execute a command" to run console command "/gui"
        format gui slot 6 of player with stone named "It will run the function doSomething()" to run function doSomething()
        format gui slot 7 of player with stone named "It will close and then run the function doSomething()" to close then run function doSomething()
        format gui slot 8 of player with stone named "It will run doSomething() if you click on it with a stone" to run function doSomething() with cursor stone
        format gui slot 9 of player with stone named "It will run the gui event" to run gui event
 
function doSomething(i: int = 0): #TuSKe will run this function even if it was loaded after the command above. Need 1.7.2+ for it.
    broadcast "And it did"


For You Example Code:
code_language.skript:
function Shop(p: Player):
    open virtual chest with size 5 named "&7&lC-Vagt Hjelm" to {_p}
    make gui slot 4 of {_p} with gold helmet named "&7&lC-Vagt Hjelm" with lore "&a&lKlik her &a| Hjelmen koster | &a100$" to close then run player command "/test"

command /test:
    trigger:
        make console execute command "/say test"
command /shop:
    trigger:
         Shop(Player)
 
Last edited:
just add this:

code_language.skript:
on inventory click:
    if name of current inventory of player is "&2&lVagt Shop":
        if clicked slot is 4:
            execute console command "/say you clicked"
Dident work for me either
[doublepost=1529065170,1529062722][/doublepost]
Using TuSKe can be useful for you.

Example Code:
code_language.skript:
command /guiExample:
    trigger:
        open virtual chest inventory to player
        format gui slot 0 of player with stone named "It won't do anything"
        format gui slot 1 of player with stone named "It will just close" to close
        format gui slot 2 of player with stone named "It will just close but only with pressing a number key" to close using number key
        format gui slot 3 of player with stone named "It will make the player execute a command, but he might not have permission" to run player command "/gui"
        format gui slot 4 of player with stone named "It will make the player execute a command with ""*"" permission" to run player command "/gui" with permission "*"
        format gui slot 5 of player with stone named "It will make the console execute a command" to run console command "/gui"
        format gui slot 6 of player with stone named "It will run the function doSomething()" to run function doSomething()
        format gui slot 7 of player with stone named "It will close and then run the function doSomething()" to close then run function doSomething()
        format gui slot 8 of player with stone named "It will run doSomething() if you click on it with a stone" to run function doSomething() with cursor stone
        format gui slot 9 of player with stone named "It will run the gui event" to run gui event
 
function doSomething(i: int = 0): #TuSKe will run this function even if it was loaded after the command above. Need 1.7.2+ for it.
    broadcast "And it did"


For You Example Code:
code_language.skript:
function Shop(p: Player):
    open virtual chest with size 5 named "&7&lC-Vagt Hjelm" to {_p}
    make gui slot 4 of {_p} with gold helmet named "&7&lC-Vagt Hjelm" with lore "&a&lKlik her &a| Hjelmen koster | &a100$" to close then run player command "/test"

command /test:
    trigger:
        make console execute command "/say test"
command /shop:
    trigger:
         Shop(Player)
Both of the codes you sent dident work.
Maybe you could say which plugins I need
 
Status
Not open for further replies.