Solved Skript wont work

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

Attachments

  • Celle.sk
    1.5 KB · Views: 186
  • vagtchest.sk
    2.6 KB · Views: 203
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_language.skript:
on rightclick on a trapped chest:
    wait 1 tick
    if inventory name of player's current inventory is "&cVagt Sælge Kiste":
        stop
    else:
        open chest with 6 rows named "&cVagt Sælge Kiste" to player
        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
Reactions: Petervpg
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_language.skript:
on rightclick on a trapped chest:
    wait 1 tick
    if inventory name of player's current inventory is "&cVagt Sælge Kiste":
        stop
    else:
        open chest with 6 rows named "&cVagt Sælge Kiste" to player
        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!
So it dont work I pasted your code in but i still dident work
here is the code:
code_language.skript:
variables:
 {sellprice::s306} = 250
 {sellprice::s307} = 250
 {sellprice::s308} = 250
 {sellprice::s309} = 250
 {sellprice::s295} = 15
 {sellprice::s296} = 120
 {sellprice::s297} = 500
 {sellprice::s257} = 20
 {sellprice::s267} = 20
 {sellprice::s17} = 15
 {sellprice::s145} = 120
 {sellprice::s81} = 10
 {sellprice::s1} = 0.01
 {sellprice::s4} = 0.01
 {sellprice::s3} = 1
 {sellprice::s15} = 3
 {sellprice::s170} = 1300
 {sellprice::s293} = 100
 {sellprice::s145} = 50
 {sellprice::s276} = 30
 {sellprice::s326} = 30
 {sellprice::s314} = 250
 {sellprice::s313} = 250
 {sellprice::s261} = 50
 {sellprice::s310} = 300
 {sellprice::s311} = 300
 {sellprice::s312} = 300
 {sellprice::s313} = 300
 {sellprice::s360} = 35
 {sellprice::S20} = 0

command /vagtchest:
 permission: vagtchest.admin
 trigger:
  give player a trapped chest named "&cVagt Sælge Kiste"
on rightclick on a trapped chest:
  wait 1 tick
  if inventory name of player's current inventory is "&cVagt Sælge Kiste":
  stop
else:
  open chest with 6 rows named "&cVagt Sælge Kiste" to player
  set {vagt.sell::%player%} to true
on quit:
 delete {vagt.sell::%player%}
on inventory close:
 if inventory name of player's current inventory is "&bKaution":
  remove the player from {kaution::*}
 if {vagt.sell::%player%} is set:
  delete {vagt.sell::%player%}
  set {_l} to location of player's targeted block
  set {_money} to 0
  loop all items in player's current inventory:
   if {sellprice::s%id of loop-item%} is set:
    set {_i::*} to split "%loop-item%" at " "
    if {_i::1} parsed as integer is set:
     add ({sellprice::s%id of loop-item%} * ({_i::1} parsed as integer) ) to {_money}
     set {_n} to "%type of loop-item%"
     replace all " " in {_n} with "_"
     add ( {_i::1} parsed as integer ) to {_fitems::%{_n}%}
    else:
     add {sellprice::s%id of loop-item%} to {_money}
     set {_n} to "%type of loop-item%"
     replace all " " in {_n} with "_"
     add 1 to {_fitems::%{_n}%}
   else:
    message "&3%loop-item% &cEr Ikke Noget Værd!!"
    if player can hold loop-item:
     give loop-item to player
    else:
     drop loop-item at location of player
     message "&cDropped&a %loop-item%&c ved dig fordi du ikke har plads i dit inventory!"
  message "&6            Items&6:"
  message ""
  loop {_fitems::*}:
   set {_name} to "%loop-index%"
   replace all "_" in {_name} with " "
   message "&7- &c%loop-value% &6%{_name}%"
  message ""
  message "&cDu Har Tjent&6 $%{_money}%"
  add {_money} to player's balance
  wait 1 tick
  clear inventory of block at {_l}
[doublepost=1511003887,1511003637][/doublepost]
Can you post the internal error?
I dont know what the internal error is
 
Last edited:
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.
 
So I looked at my skript and then I saw this:
code_language.skript:
on rightclick on a trapped chest:
    wait 1 tick
    if inventory name of player's current inventory is "&cVagt Sælge Kiste":
        stop
    else:
        open chest with 6 rows named "&cVagt Sælge Kiste" to player
        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_language.skript:
variables:
    {sellprice::s306} = 250
    {sellprice::s307} = 250
    {sellprice::s308} = 250
    {sellprice::s309} = 250
    {sellprice::s295} = 15
    {sellprice::s296} = 120
    {sellprice::s297} = 500
    {sellprice::s257} = 20
    {sellprice::s267} = 20
    {sellprice::s17} = 15
    {sellprice::s145} = 120
    {sellprice::s81} = 10
    {sellprice::s1} = 0.01
    {sellprice::s4} = 0.01
    {sellprice::s3} = 1
    {sellprice::s15} = 3
    {sellprice::s170} = 1300
    {sellprice::s293} = 100
    {sellprice::s145} = 50
    {sellprice::s276} = 30
    {sellprice::s326} = 30
    {sellprice::s314} = 250
    {sellprice::s313} = 250
    {sellprice::s261} = 50
    {sellprice::s310} = 300
    {sellprice::s311} = 300
    {sellprice::s312} = 300
    {sellprice::s313} = 300
    {sellprice::s360} = 35
    {sellprice::S20} = 0

command /vagtchest:
    permission: vagtchest.admin
    trigger:
        give player a trapped chest named "&cVagt Sælge Kiste"

on rightclick on a trapped chest:
        wait 1 tick
        if inventory name of player's current inventory is "&cVagt Sælge Kiste":
                open chest with 6 rows named "&cVagt Sælge Kiste" to player
                set {vagt.sell::%player%} to true
on quit:
    delete {vagt.sell::%player%}
on inventory close:
    if {vagt.sell::%player%} is set:
        delete {vagt.sell::%player%}
        set {_l} to location of player's targeted block
        set {_money} to 0
        loop all items in player's current inventory:
            if {sellprice::s%id of loop-item%} is set:
                set {_i::*} to split "%loop-item%" at " "
                if {_i::1} parsed as integer is set:
                    add ({sellprice::s%id of loop-item%} * ({_i::1} parsed as integer) ) to {_money}
                    set {_n} to "%type of loop-item%"
                    replace all " " in {_n} with "_"
                    add ( {_i::1} parsed as integer ) to {_fitems::%{_n}%}
                else:
                    add {sellprice::s%id of loop-item%} to {_money}
                    set {_n} to "%type of loop-item%"
                    replace all " " in {_n} with "_"
                    add 1 to {_fitems::%{_n}%}
            else:
                message "&3%loop-item% &cEr Ikke Noget Værd!!"
                if player can hold loop-item:
                    give loop-item to player
                else:
                    drop loop-item at location of player
                    message "&cDropped&a %loop-item%&c ved dig fordi du ikke har plads i dit inventory!"
        message "&6            Items&6:"
        message ""
        loop {_fitems::*}:
            set {_name} to "%loop-index%"
            replace all "_" in {_name} with " "
            message "&7- &c%loop-value% &6%{_name}%"
        message ""
        message "&cDu Har Tjent&6 $%{_money}%"
        add {_money} to player's balance
        wait 1 tick
        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:')
 
Last edited:
Status
Not open for further replies.