Make player execute command

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

Rexeee

Member
Aug 13, 2018
1
0
0
21
Hello,
I have been trying to make a GUI work for an hour or so now.
I can't seem to find the problem.

I'm using Skript 2.2
Minecraft 1.8.9
I use SkQuery (Don't know version) and SkRayFall 1.4

The lines 28-36 do not work. The items load in the menu, but when I click on them, nothing happens. The GUI doesen't even close.
When I remove the name and lore, it closes, but just doesen't run the commands?

code_language.skript:
on join:
    if {Ontime::ontimepoints::%uuid of player%} is not a number:
        set {Ontime::ontimepoints::%uuid of player%} to 0
    if {Ontime::total::%uuid of player%} is not a number:
        set {Ontime::total::%uuid of player%} to 0
    if {Suicide::cooldown::%uuid of player%} is not a number:
        set {Suicide::cooldown::%uuid of player%} to 0
every minute:
    loop all players:
        add 1 to {Ontime::ontimepoints::%uuid of loop-player%}
        add 1 to {Ontime::total::%uuid of loop-player%}
on sign change:
    line 1 is "[ontimeshop]"
    player is op
    set line 1 to "&c&lONTIME SHOP"
    set line 2 to "&8Klik her, for at"
    set line 3 to "&8åbne ontime"
    set line 4 to "&8shoppen."
    stop
on click on sign:
    if line 1 is "&c&lONTIME SHOP":
        if line 2 is "&8Klik her, for at":
            if line 3 is "&8åbne ontime":
                if line 4 is "&8shoppen.":
                    wait 1 tick
                    open chest with 1 row named "" to player
                    wait 1 tick
                    format slot 0 of player with gray glass pane named "&7Du har &6%{Ontime::ontimepoints::%uuid of player%}% ontime points." to be unstealable
                    format slot 1 of player with book and quill named "&fBog til ansøgning" with lore "&7Klik her, for at købe||&7en &fbog til ansøgning,&7 som||&7du kan bruge, for at ansøge på||&7serveren.||&cDet er dit eget ansvar, at have plads i dit inventory.||&6Pris: &760" to close then run [set {_lort} to true]->[wait 1 tick]->[make player execute command "ontimeshop 1"]
                    format slot 2 of player with iron sword named "&fJernsværd" with lore "&7Klik her, for at købe||&7et &fjernsværd,&7 som||&7du kan bruge, for at dræbe spillere på||&7serveren.||&cDet er dit eget ansvar, at have plads i dit inventory.||&6Pris: &7120" to close then run [set {_lort} to true]->[wait 1 tick]->[make player execute command "ontimeshop 2"]
                    format slot 3 of player with redstone named "&fReduceret cooldown på &6/suicide" with lore "&7Klik her, for at købe||&7&freduceret cooldown på /suicide,&7 som||&7du kan bruge, for at dræbe dig selv oftere på||&7serveren.||&6Pris: &7300" to close then run [set {_lort} to true]->[wait 1 tick]->[make player execute command "ontimeshop 3"]
                    format slot 4 of player with iron helmet named "&fFuldt sæt jernarmor" with lore "&7Klik her, for at købe||&7et &ffuldt sæt jernarmor,&7 som||&7du kan bruge, for at beskytte dig selv på||&7serveren.||&cDet er dit eget ansvar, at have plads i dit inventory.||&6Pris: &7360" to close then run [set {_lort} to true]->[wait 1 tick]->[make player execute command "ontimeshop 4"]
                    format slot 5 of player with wood pickaxe named "&fPermanent træhakke" with lore "&7Klik her, for at købe||&7en &fpermanent træhakke,&7 som||&7vil give dig en træhakke hver gang du dør.||&7serveren.||&cTræder i kraft næste gang, du dør.||&8Du kan kun have 1 permanent hakke aktiv ad gangen.||&6Pris: &7480" to close then run [set {_lort} to true]->[wait 1 tick]->[make player execute command "ontimeshop 5"]
                    format slot 6 of player with stone pickaxe named "&fPermanent stenhakke" with lore "&7Klik her, for at købe||&7en &fpermanent stenhakke,&7 som||&7vil give dig en stenhakke hver gang du dør.||&7serveren.||&cTræder i kraft næste gang, du dør.||&8Du kan kun have 1 permanent hakke aktiv ad gangen.||&6Pris: &7720" to close then run [set {_lort} to true]->[wait 1 tick]->[make player execute command "ontimeshop 6"]
                    format slot 7 of player with iron pickaxe named "&fPermanent jernhakke" to close then run [set {_lort} to true]->[wait 1 tick]->[make player execute command "ontimeshop 7"]
                    format slot 8 of player with gray glass pane named "&7Du har &6%{Ontime::ontimepoints::%uuid of player%}% ontime points." to be unstealable
command /ontimeshop [<text>]:
    trigger:
        wait 1 tick
        if {_lort} is true:
            set {_lort} to false
            if arg 1 is "1":
                if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 60:
                    remove 60 from {Ontime::ontimepoints::%uuid of player%}
                    give player book and quill
                    message "&8[&cOntime-shoppen&8] &7Du har købt en &6bog til ansøgning &7fra ontime-shoppen."
                    stop
                else:
                    message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
                    stop
            if arg 1 is "2":
                if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 120:
                    remove 120 from {Ontime::ontimepoints::%uuid of player%}
                    give player iron sword
                    message "&8[&cOntime-shoppen&8] &7Du har købt et &6jernsværd &7fra ontime-shoppen."
                    stop
                else:
                    message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
                    stop
            if arg 1 is "3":
                if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 300:
                    if player does not have permission "suicide.cooldown":
                        remove 300 from {Ontime::ontimepoints::%uuid of player%}
                        command "pex user %player% add suicide.cooldown"
                        message "&8[&cOntime-shoppen&8] &7Du har købt &6reduceret cooldown på /suicide &7fra ontime-shoppen."
                        stop
                    else:
                        message "&8[&cOntime-shoppen&8] &7Du har allerede købt denne fordel."
                        stop
                else:
                    message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
                    stop
            if arg 1 is "4":
                if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 360:
                    remove 360 from {Ontime::ontimepoints::%uuid of player%}
                    give player iron helmet
                    give player iron chestplate
                    give player iron leggings
                    give player iron boots
                    message "&8[&cOntime-shoppen&8] &7Du har købt et &6fuldt sæt jernarmor &7fra ontime-shoppen."
                    stop
                else:
                    message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
                    stop
            if arg 1 is "5":
                if player does not have permission "server.permanent.ironpick":
                    if player does not have permission "server.permanent.stonepick":
                        if player does not have permission "server.permanent.woodpick":
                            if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 360:
                                remove 360 from {Ontime::ontimepoints::%uuid of player%}
                                message "&8[&cOntime-shoppen&8] &7Du har købt en &6permanent træhakke &7fra ontime-shoppen."
                                command "pex user %player% add server.permanent.woodpick"
                                stop
                            else:
                                message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
                                stop
                        else:
                            message "&8[&cOntime-shoppen&8] &7Du har allerede købt denne fordel."
                            stop
                    else:
                        message "&8[&cOntime-shoppen&8] &7Du har allerede købt en permanent stenhakke, så hvad er meningen i at købe træhakken?"
                        stop
                else:
                    message "&8[&cOntime-shoppen&8] &7Du har allerede købt en permanent jernhakke, så hvad er meningen i at købe træhakken?"
                    stop
            if arg 1 is "6":
                if player does not have permission "server.permanent.ironpick":
                    if player does not have permission "server.permanent.stonepick":
                        if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 720:
                            remove 720 from {Ontime::ontimepoints::%uuid of player%}
                            message "&8[&cOntime-shoppen&8] &7Du har købt en &6permanent stenhakke &7fra ontime-shoppen."
                            command "pex user %player% add server.permanent.stonepick"
                            stop
                        else:
                            message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
                            stop
                    else:
                        message "&8[&cOntime-shoppen&8] &7Du har allerede købt denne fordel."
                        stop
                else:
                    message "&8[&cOntime-shoppen&8] &7Du har allerede købt en permanent jernhakke, så hvad er meningen i at købe stenhakken?"
                    stop
            if arg 1 is "7":
                if player does not have permission "server.permanent.ironpick":
                    if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 1440:
                        remove 1400 from {Ontime::ontimepoints::%uuid of player%}
                        message "&8[&cOntime-shoppen&8] &7Du har købt en &6permanent jernhakke &7fra ontime-shoppen."
                        command "pex user %player% add server.permanent.ironpick"
                        stop
                    else:
                        message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
                        stop
                else:
                    message "&8[&cOntime-shoppen&8] &7Du har allerede købt denne fordel."
                    stop
        else:
            make player execute command "awpdjaopwijdoaw"
            stop
on respawn:
    if player has permission "server.permanent.ironpick":
        give player iron pickaxe named "&fPermanent jernhakke"
        stop
    if player has permission "server.permanent.stonepick":
        give player stone pickaxe named "&fPermanent stenhakke"
        stop
    if player has permission "server.permanent.woodpick":
        give player wood pickaxe named "&fPermanent træhakke"
        stop
on drop:
    name of item is "&fPermanent jernhakke","&fPermanent stenhakke" or "&fPermanent træhakke":
        cancel event
command /suicide [<text>]:
    aliases: selvmord
    trigger:
        if player does not have permission "vagt.vagt":
            if {Suicide::cooldown::%uuid of player%} is not greater than 0:
                kill the player
                if player has permission "suicide.cooldown":
                    set {Suicide::cooldown::%uuid of player%} to 2
                    stop
                else:
                    set {Suicide::cooldown::%uuid of player%} to 5
                    stop
                stop
            else:
                message "&8[&cServer&8] &7Vent &6%{Suicide::cooldown::%uuid of player%}% minut(ter), &7for at dræbe dig selv igen."
                stop
        else:
            message "&8[&cServer&8] &7Du skal jo ikke dræbe dig selv som vagt, din klaphat."
            stop
command /addontimepoints [<player>] [<number>] [<text>]:
    permission: server.ontime
    permission message: &cDu har ikke adgang til denne kommando.
    trigger:
        if arg 1 is a player:
            if arg 2 is a number:
                add arg 2 to {Ontime::ontimepoints::%uuid of player%}
                message "&8[&cServer&8] &7Du tilføjede &6%arg 2% ontime points til &6%arg 1%."
                stop
            else:
                message "&8[&cServer&8] &7Du skal skrive et nummer som dit argument nummer 2."
                stop
        else:
            message "&8[&cServer&8] &7Du skal skrive et spillernavn som dit argument nummer 1."
            stop
 
I use SkQuery (Don't know version) and SkRayFall 1.4
SkRayfall is ok, but it's better to use TuSKe GUI or vanilla ones, I recommend in my opinion the TuSKe ones, are more simple and allows me to make it aesthetically better and more easily.

To make a gui with TuSKe, you can use this info in the docs:
https://docs.skunity.com/syntax/effects/Make GUI

Take this as a clear example to execute a command with a gui:
code_language.skript:
open virtual chest inventory with size 3 named "Put the gui's name here" to player
format gui slot 13 of player with diamond to run player command "/gamemode c"
/\ This example will make a gui like a normal chest one with a diamond in the exact center, it will run the command /gamemode c that is to change to creative mode when clicking on the diamond.

Hope I helped! :emoji_grinning:
 
Status
Not open for further replies.