Hey, someone know whats wrong with this code?

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

saengerjakob

Member
Jan 10, 2023
2
0
1
23
Skript says line 15 "Can't understand this section: trigger". But idk whats wrong with it...

command /Handbuch:
trigger:
if player's world is "MiniLeben":
trigger:
set {_waited} to difference between {handbuch.%player%.lastused} and now
if {_waited} is less than 1 minute:
message "&8[&6&lLeben 4.0&8] &r&7Du musst %difference between a minute and {_waited}% warten, bevor die diesen Befehl erneut verwenden kannst!"
stop

player doesn't have space for {book}:
message "&8[&6&lLeben 4.0&8] &r&7Du hast nicht genug Platz in deinem Inventar!"
stop

give {book} to player
message "&8[&6&lLeben 4.0&8] &r&7Du hast ein Handbuch bekommen!"

set {handbuch.%player%.lastused} to now
else:
message "Test"
 
Skript says line 15 "Can't understand this section: trigger". But idk whats wrong with it...

command /Handbuch:
trigger:
if player's world is "MiniLeben":
trigger:
set {_waited} to difference between {handbuch.%player%.lastused} and now
if {_waited} is less than 1 minute:
message "&8[&6&lLeben 4.0&8] &r&7Du musst %difference between a minute and {_waited}% warten, bevor die diesen Befehl erneut verwenden kannst!"
stop

player doesn't have space for {book}:
message "&8[&6&lLeben 4.0&8] &r&7Du hast nicht genug Platz in deinem Inventar!"
stop

give {book} to player
message "&8[&6&lLeben 4.0&8] &r&7Du hast ein Handbuch bekommen!"

set {handbuch.%player%.lastused} to now
else:
message "Test"
to get help please use a code block
upload_2023-1-11_18-13-0.png


fine ill be nice this time, 'trigger' is only used once in the command, there is no need to trigger the code again
 
Last edited:
you cant use trigger more than once in a command. Stop will cancel everything after it. You have to indent after a colon, but in this case it can be removed.
Code:
command /Handbuch:
        trigger:
                if player's world is "MiniLeben":
             -->        trigger:
                                set {_waited} to difference between {handbuch.%player%.lastused} and now
                                if {_waited} is less than 1 minute:
                                        message "&8[&6&lLeben 4.0&8] &r&7Du musst %difference between a minute and {_waited}% warten, bevor die diesen Befehl erneut verwenden kannst!"
                      this -->          stop
  
               cancels this -->          player doesn't have space for {book}:   <--- youre supposed to indent after one of these
                            -->          message "&8[&6&lLeben 4.0&8] &r&7Du hast nicht genug Platz in deinem Inventar!"
                            -->          stop
      
                                give {book} to player
                                message "&8[&6&lLeben 4.0&8] &r&7Du hast ein Handbuch bekommen!"
  
                                set {handbuch.%player%.lastused} to now
                else:
                        message "Test"
 
  • Like
Reactions: Merrical
Status
Not open for further replies.