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.

Solved Skript wont work

Discussion in 'Skript' started by Petervpg, Nov 17, 2017.

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

    Petervpg Member

    Joined:
    Jul 27, 2017
    Messages:
    18
    Likes Received:
    0
    Hello my name is Petervpg
    I have made and found some skripts and 2 of them wont work
    im playing 1.8.9 on my server
    Im Danish btw so ignore the messeges and that :emoji_grinning:
    I'll upload the skripts and 2 pictures of the errors
    (Celle.sk▼)
    Celle.png
    (vagtchest.sk▼)
    Vagtchest.png
    Thanks in advance
     

    Attached Files:

  2. HiddenDev

    HiddenDev Member

    Joined:
    Sep 19, 2017
    Messages:
    43
    Likes Received:
    2
    Hey, next time don't put a download for them, because it takes way more time. Press the [+] button and click </> Code, then select Skript, then paste the code there.

    I found your problem it was with a part of "vagtchest.sk". This code I threw together should work.

    Code (Skript):
    1. on rightclick on a trapped chest:
    2.     wait 1 tick
    3.     if inventory name of player's current inventory is "&cVagt Sælge Kiste":
    4.         stop
    5.     else:
    6.         open chest with 6 rows named "&cVagt Sælge Kiste" to player
    7.         set {vagt.sell::%player%} to true
    There wasn't a stop if their inventory was called "&cVagt Sælge Kiste" meaning it didn't know what to do where you placed the else. The last problem was after the else remember anytime a colon ":" is used you need to tab whatever is there. Hopefully you will learn from this. Any problems reply back to this thread.

    Enjoy!
     
    • Like Like x 1
  3. Pikachu

    Moderator Supporter Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    871
    Likes Received:
    139
    Medals:
    Can you post the internal error?
     
  4. Petervpg

    Petervpg Member

    Joined:
    Jul 27, 2017
    Messages:
    18
    Likes Received:
    0
    So it dont work I pasted your code in but i still dident work
    here is the code:
    Code (Skript):
    1. variables:
    2.  {sellprice::s306} = 250
    3.  {sellprice::s307} = 250
    4.  {sellprice::s308} = 250
    5.  {sellprice::s309} = 250
    6.  {sellprice::s295} = 15
    7.  {sellprice::s296} = 120
    8.  {sellprice::s297} = 500
    9.  {sellprice::s257} = 20
    10.  {sellprice::s267} = 20
    11.  {sellprice::s17} = 15
    12.  {sellprice::s145} = 120
    13.  {sellprice::s81} = 10
    14.  {sellprice::s1} = 0.01
    15.  {sellprice::s4} = 0.01
    16.  {sellprice::s3} = 1
    17.  {sellprice::s15} = 3
    18.  {sellprice::s170} = 1300
    19.  {sellprice::s293} = 100
    20.  {sellprice::s145} = 50
    21.  {sellprice::s276} = 30
    22.  {sellprice::s326} = 30
    23.  {sellprice::s314} = 250
    24.  {sellprice::s313} = 250
    25.  {sellprice::s261} = 50
    26.  {sellprice::s310} = 300
    27.  {sellprice::s311} = 300
    28.  {sellprice::s312} = 300
    29.  {sellprice::s313} = 300
    30.  {sellprice::s360} = 35
    31.  {sellprice::S20} = 0
    32.  
    33. command /vagtchest:
    34.  permission: vagtchest.admin
    35.  trigger:
    36.   give player a trapped chest named "&cVagt Sælge Kiste"
    37. on rightclick on a trapped chest:
    38.   wait 1 tick
    39.   if inventory name of player's current inventory is "&cVagt Sælge Kiste":
    40.   stop
    41. else:
    42.   open chest with 6 rows named "&cVagt Sælge Kiste" to player
    43.   set {vagt.sell::%player%} to true
    44. on quit:
    45.  delete {vagt.sell::%player%}
    46. on inventory close:
    47.  if inventory name of player's current inventory is "&bKaution":
    48.   remove the player from {kaution::*}
    49.  if {vagt.sell::%player%} is set:
    50.   delete {vagt.sell::%player%}
    51.   set {_l} to location of player's targeted block
    52.   set {_money} to 0
    53.   loop all items in player's current inventory:
    54.    if {sellprice::s%id of loop-item%} is set:
    55.     set {_i::*} to split "%loop-item%" at " "
    56.     if {_i::1} parsed as integer is set:
    57.      add ({sellprice::s%id of loop-item%} * ({_i::1} parsed as integer) ) to {_money}
    58.      set {_n} to "%type of loop-item%"
    59.      replace all " " in {_n} with "_"
    60.      add ( {_i::1} parsed as integer ) to {_fitems::%{_n}%}
    61.     else:
    62.      add {sellprice::s%id of loop-item%} to {_money}
    63.      set {_n} to "%type of loop-item%"
    64.      replace all " " in {_n} with "_"
    65.      add 1 to {_fitems::%{_n}%}
    66.    else:
    67.     message "&3%loop-item% &cEr Ikke Noget Værd!!"
    68.     if player can hold loop-item:
    69.      give loop-item to player
    70.     else:
    71.      drop loop-item at location of player
    72.      message "&cDropped&a %loop-item%&c ved dig fordi du ikke har plads i dit inventory!"
    73.   message "&6            Items&6:"
    74.   message ""
    75.   loop {_fitems::*}:
    76.    set {_name} to "%loop-index%"
    77.    replace all "_" in {_name} with " "
    78.    message "&7- &c%loop-value% &6%{_name}%"
    79.   message ""
    80.   message "&cDu Har Tjent&6 $%{_money}%"
    81.   add {_money} to player's balance
    82.   wait 1 tick
    83.   clear inventory of block at {_l}
    --- Double Post Merged, Nov 18, 2017, Original Post Date: Nov 18, 2017 ---
    I dont know what the internal error is
     
    #4 Petervpg, Nov 18, 2017
    Last edited: Nov 18, 2017
  5. HiddenDev

    HiddenDev Member

    Joined:
    Sep 19, 2017
    Messages:
    43
    Likes Received:
    2
    What I was provided with there is no possible way to find out what your internal error is. I fixed what could be fixed in the screenshots. I ain't no mind reader, although I would love that.
     
  6. Petervpg

    Petervpg Member

    Joined:
    Jul 27, 2017
    Messages:
    18
    Likes Received:
    0
    So I looked at my skript and then I saw this:
    Code (Skript):
    1. on rightclick on a trapped chest:
    2.     wait 1 tick
    3.     if inventory name of player's current inventory is "&cVagt Sælge Kiste":
    4.         stop
    5.     else:
    6.         open chest with 6 rows named "&cVagt Sælge Kiste" to player
    7.         set {vagt.sell::%player%} to true
    It was the "Stop" And the "Else:"
    so then i removed those 2 and it solved alot of the problems but i still got 2 so i think you maybe could help me with it
    Heres my new code:
    Code (Skript):
    1. variables:
    2.     {sellprice::s306} = 250
    3.     {sellprice::s307} = 250
    4.     {sellprice::s308} = 250
    5.     {sellprice::s309} = 250
    6.     {sellprice::s295} = 15
    7.     {sellprice::s296} = 120
    8.     {sellprice::s297} = 500
    9.     {sellprice::s257} = 20
    10.     {sellprice::s267} = 20
    11.     {sellprice::s17} = 15
    12.     {sellprice::s145} = 120
    13.     {sellprice::s81} = 10
    14.     {sellprice::s1} = 0.01
    15.     {sellprice::s4} = 0.01
    16.     {sellprice::s3} = 1
    17.     {sellprice::s15} = 3
    18.     {sellprice::s170} = 1300
    19.     {sellprice::s293} = 100
    20.     {sellprice::s145} = 50
    21.     {sellprice::s276} = 30
    22.     {sellprice::s326} = 30
    23.     {sellprice::s314} = 250
    24.     {sellprice::s313} = 250
    25.     {sellprice::s261} = 50
    26.     {sellprice::s310} = 300
    27.     {sellprice::s311} = 300
    28.     {sellprice::s312} = 300
    29.     {sellprice::s313} = 300
    30.     {sellprice::s360} = 35
    31.     {sellprice::S20} = 0
    32.  
    33. command /vagtchest:
    34.     permission: vagtchest.admin
    35.     trigger:
    36.         give player a trapped chest named "&cVagt Sælge Kiste"
    37.  
    38. on rightclick on a trapped chest:
    39.         wait 1 tick
    40.         if inventory name of player's current inventory is "&cVagt Sælge Kiste":
    41.                 open chest with 6 rows named "&cVagt Sælge Kiste" to player
    42.                 set {vagt.sell::%player%} to true
    43. on quit:
    44.     delete {vagt.sell::%player%}
    45. on inventory close:
    46.     if {vagt.sell::%player%} is set:
    47.         delete {vagt.sell::%player%}
    48.         set {_l} to location of player's targeted block
    49.         set {_money} to 0
    50.         loop all items in player's current inventory:
    51.             if {sellprice::s%id of loop-item%} is set:
    52.                 set {_i::*} to split "%loop-item%" at " "
    53.                 if {_i::1} parsed as integer is set:
    54.                     add ({sellprice::s%id of loop-item%} * ({_i::1} parsed as integer) ) to {_money}
    55.                     set {_n} to "%type of loop-item%"
    56.                     replace all " " in {_n} with "_"
    57.                     add ( {_i::1} parsed as integer ) to {_fitems::%{_n}%}
    58.                 else:
    59.                     add {sellprice::s%id of loop-item%} to {_money}
    60.                     set {_n} to "%type of loop-item%"
    61.                     replace all " " in {_n} with "_"
    62.                     add 1 to {_fitems::%{_n}%}
    63.             else:
    64.                 message "&3%loop-item% &cEr Ikke Noget Værd!!"
    65.                 if player can hold loop-item:
    66.                     give loop-item to player
    67.                 else:
    68.                     drop loop-item at location of player
    69.                     message "&cDropped&a %loop-item%&c ved dig fordi du ikke har plads i dit inventory!"
    70.         message "&6            Items&6:"
    71.         message ""
    72.         loop {_fitems::*}:
    73.             set {_name} to "%loop-index%"
    74.             replace all "_" in {_name} with " "
    75.             message "&7- &c%loop-value% &6%{_name}%"
    76.         message ""
    77.         message "&cDu Har Tjent&6 $%{_money}%"
    78.         add {_money} to player's balance
    79.         wait 1 tick
    80.         clear inventory of block at {_l}
    The errors is: 'Player's current inventory' is not an item stack (Vagtchest1.sk, line 40: if inventory name of players current inventory is "&cVagt Sælge Kiste":') and
    can't understand this event: 'on inventory close' (Vagtchest1.sk, line 45: on inventory close:')
     
    #6 Petervpg, Nov 19, 2017
    Last edited: Nov 19, 2017
Thread Status:
Not open for further replies.

Share This Page

Loading...