1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Make player execute command

Discussion in 'Skript' started by Rexeee, Aug 13, 2018.

Thread Status:
Not open for further replies.
  1. Rexeee

    Rexeee Member

    Joined:
    Aug 13, 2018
    Messages:
    1
    Likes Received:
    0
    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 (Skript):
    1. on join:
    2.     if {Ontime::ontimepoints::%uuid of player%} is not a number:
    3.         set {Ontime::ontimepoints::%uuid of player%} to 0
    4.     if {Ontime::total::%uuid of player%} is not a number:
    5.         set {Ontime::total::%uuid of player%} to 0
    6.     if {Suicide::cooldown::%uuid of player%} is not a number:
    7.         set {Suicide::cooldown::%uuid of player%} to 0
    8. every minute:
    9.     loop all players:
    10.         add 1 to {Ontime::ontimepoints::%uuid of loop-player%}
    11.         add 1 to {Ontime::total::%uuid of loop-player%}
    12. on sign change:
    13.     line 1 is "[ontimeshop]"
    14.     player is op
    15.     set line 1 to "&c&lONTIME SHOP"
    16.     set line 2 to "&8Klik her, for at"
    17.     set line 3 to "&8åbne ontime"
    18.     set line 4 to "&8shoppen."
    19.     stop
    20. on click on sign:
    21.     if line 1 is "&c&lONTIME SHOP":
    22.         if line 2 is "&8Klik her, for at":
    23.             if line 3 is "&8åbne ontime":
    24.                 if line 4 is "&8shoppen.":
    25.                     wait 1 tick
    26.                     open chest with 1 row named "" to player
    27.                     wait 1 tick
    28.                     format slot 0 of player with gray glass pane named "&7Du har &6%{Ontime::ontimepoints::%uuid of player%}% ontime points." to be unstealable
    29.                     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"]
    30.                     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"]
    31.                     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"]
    32.                     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"]
    33.                     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"]
    34.                     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"]
    35.                     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"]
    36.                     format slot 8 of player with gray glass pane named "&7Du har &6%{Ontime::ontimepoints::%uuid of player%}% ontime points." to be unstealable
    37. command /ontimeshop [<text>]:
    38.     trigger:
    39.         wait 1 tick
    40.         if {_lort} is true:
    41.             set {_lort} to false
    42.             if arg 1 is "1":
    43.                 if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 60:
    44.                     remove 60 from {Ontime::ontimepoints::%uuid of player%}
    45.                     give player book and quill
    46.                     message "&8[&cOntime-shoppen&8] &7Du har købt en &6bog til ansøgning &7fra ontime-shoppen."
    47.                     stop
    48.                 else:
    49.                     message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
    50.                     stop
    51.             if arg 1 is "2":
    52.                 if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 120:
    53.                     remove 120 from {Ontime::ontimepoints::%uuid of player%}
    54.                     give player iron sword
    55.                     message "&8[&cOntime-shoppen&8] &7Du har købt et &6jernsværd &7fra ontime-shoppen."
    56.                     stop
    57.                 else:
    58.                     message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
    59.                     stop
    60.             if arg 1 is "3":
    61.                 if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 300:
    62.                     if player does not have permission "suicide.cooldown":
    63.                         remove 300 from {Ontime::ontimepoints::%uuid of player%}
    64.                         command "pex user %player% add suicide.cooldown"
    65.                         message "&8[&cOntime-shoppen&8] &7Du har købt &6reduceret cooldown på /suicide &7fra ontime-shoppen."
    66.                         stop
    67.                     else:
    68.                         message "&8[&cOntime-shoppen&8] &7Du har allerede købt denne fordel."
    69.                         stop
    70.                 else:
    71.                     message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
    72.                     stop
    73.             if arg 1 is "4":
    74.                 if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 360:
    75.                     remove 360 from {Ontime::ontimepoints::%uuid of player%}
    76.                     give player iron helmet
    77.                     give player iron chestplate
    78.                     give player iron leggings
    79.                     give player iron boots
    80.                     message "&8[&cOntime-shoppen&8] &7Du har købt et &6fuldt sæt jernarmor &7fra ontime-shoppen."
    81.                     stop
    82.                 else:
    83.                     message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
    84.                     stop
    85.             if arg 1 is "5":
    86.                 if player does not have permission "server.permanent.ironpick":
    87.                     if player does not have permission "server.permanent.stonepick":
    88.                         if player does not have permission "server.permanent.woodpick":
    89.                             if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 360:
    90.                                 remove 360 from {Ontime::ontimepoints::%uuid of player%}
    91.                                 message "&8[&cOntime-shoppen&8] &7Du har købt en &6permanent træhakke &7fra ontime-shoppen."
    92.                                 command "pex user %player% add server.permanent.woodpick"
    93.                                 stop
    94.                             else:
    95.                                 message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
    96.                                 stop
    97.                         else:
    98.                             message "&8[&cOntime-shoppen&8] &7Du har allerede købt denne fordel."
    99.                             stop
    100.                     else:
    101.                         message "&8[&cOntime-shoppen&8] &7Du har allerede købt en permanent stenhakke, så hvad er meningen i at købe træhakken?"
    102.                         stop
    103.                 else:
    104.                     message "&8[&cOntime-shoppen&8] &7Du har allerede købt en permanent jernhakke, så hvad er meningen i at købe træhakken?"
    105.                     stop
    106.             if arg 1 is "6":
    107.                 if player does not have permission "server.permanent.ironpick":
    108.                     if player does not have permission "server.permanent.stonepick":
    109.                         if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 720:
    110.                             remove 720 from {Ontime::ontimepoints::%uuid of player%}
    111.                             message "&8[&cOntime-shoppen&8] &7Du har købt en &6permanent stenhakke &7fra ontime-shoppen."
    112.                             command "pex user %player% add server.permanent.stonepick"
    113.                             stop
    114.                         else:
    115.                             message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
    116.                             stop
    117.                     else:
    118.                         message "&8[&cOntime-shoppen&8] &7Du har allerede købt denne fordel."
    119.                         stop
    120.                 else:
    121.                     message "&8[&cOntime-shoppen&8] &7Du har allerede købt en permanent jernhakke, så hvad er meningen i at købe stenhakken?"
    122.                     stop
    123.             if arg 1 is "7":
    124.                 if player does not have permission "server.permanent.ironpick":
    125.                     if {Ontime::ontimepoints::%uuid of player%} is greater than or equal to 1440:
    126.                         remove 1400 from {Ontime::ontimepoints::%uuid of player%}
    127.                         message "&8[&cOntime-shoppen&8] &7Du har købt en &6permanent jernhakke &7fra ontime-shoppen."
    128.                         command "pex user %player% add server.permanent.ironpick"
    129.                         stop
    130.                     else:
    131.                         message "&8[&cOntime-shoppen&8] &7Du har ikke råd til dette."
    132.                         stop
    133.                 else:
    134.                     message "&8[&cOntime-shoppen&8] &7Du har allerede købt denne fordel."
    135.                     stop
    136.         else:
    137.             make player execute command "awpdjaopwijdoaw"
    138.             stop
    139. on respawn:
    140.     if player has permission "server.permanent.ironpick":
    141.         give player iron pickaxe named "&fPermanent jernhakke"
    142.         stop
    143.     if player has permission "server.permanent.stonepick":
    144.         give player stone pickaxe named "&fPermanent stenhakke"
    145.         stop
    146.     if player has permission "server.permanent.woodpick":
    147.         give player wood pickaxe named "&fPermanent træhakke"
    148.         stop
    149. on drop:
    150.     name of item is "&fPermanent jernhakke","&fPermanent stenhakke" or "&fPermanent træhakke":
    151.         cancel event
    152. command /suicide [<text>]:
    153.     aliases: selvmord
    154.     trigger:
    155.         if player does not have permission "vagt.vagt":
    156.             if {Suicide::cooldown::%uuid of player%} is not greater than 0:
    157.                 kill the player
    158.                 if player has permission "suicide.cooldown":
    159.                     set {Suicide::cooldown::%uuid of player%} to 2
    160.                     stop
    161.                 else:
    162.                     set {Suicide::cooldown::%uuid of player%} to 5
    163.                     stop
    164.                 stop
    165.             else:
    166.                 message "&8[&cServer&8] &7Vent &6%{Suicide::cooldown::%uuid of player%}% minut(ter), &7for at dræbe dig selv igen."
    167.                 stop
    168.         else:
    169.             message "&8[&cServer&8] &7Du skal jo ikke dræbe dig selv som vagt, din klaphat."
    170.             stop
    171. command /addontimepoints [<player>] [<number>] [<text>]:
    172.     permission: server.ontime
    173.     permission message: &cDu har ikke adgang til denne kommando.
    174.     trigger:
    175.         if arg 1 is a player:
    176.             if arg 2 is a number:
    177.                 add arg 2 to {Ontime::ontimepoints::%uuid of player%}
    178.                 message "&8[&cServer&8] &7Du tilføjede &6%arg 2% ontime points til &6%arg 1%."
    179.                 stop
    180.             else:
    181.                 message "&8[&cServer&8] &7Du skal skrive et nummer som dit argument nummer 2."
    182.                 stop
    183.         else:
    184.             message "&8[&cServer&8] &7Du skal skrive et spillernavn som dit argument nummer 1."
    185.             stop
     
  2. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    skquery guis are not good, use vanilla skript or tuske
     
    • Agree Agree x 1
  3. Aidanete

    Aidanete Active Member

    Joined:
    Apr 11, 2017
    Messages:
    139
    Likes Received:
    10
    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%20GUI

    Take this as a clear example to execute a command with a gui:
    Code (Skript):
    1. open virtual chest inventory with size 3 named "Put the gui's name here" to player
    2. 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:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...