Skript Problem - Incorrect Responce

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

kittkarrkitt

Supporter
Jan 4, 2021
33
0
6
Hi, I need help with figuring out the problem behind my small code here.

I have made a command which will give me items the way I specify them to be given (Get and Give).

The first part of the Skript works correctly, from the first "if arg-1 is ..." on until the second "if arg-1 is ...".
When I place a second if arg-1 is with different arg-2's following it, it keeps showing the output that arg-1 (second arg-1 in the skript) gives, combined with its special arg-2's.

(changing "else if arg-1" to "if arg-1" doesn't change anything.)

Any solutions?

!!!! SKRIPT:

options:
NoPerm: &4&l(&f&lUK&4&l) >> &4You do not have the needed permissions to use this command!
ConsoleMessage: &4&l(&f&lUK&4&l) >> &4You need to be in-game for this commando to work correctly!

command /TT [<text>] [<text>] [<text>]:
trigger:
if executor isn't a player:
message "{@ConsoleMessage}"
stop

if arg-1 isn't set:
if executor doesn't have permission "testperm.help":
message "{@NoPerm}"
stop
message ""
message "&4&l>------(&f&lTT&4&l)------<"
message ""
message "&7/TT &c>>&7 ... &7[&cGet&7, &cGive&7]"
message ""
message "&4&l>------(&f&lTT&4&l)------<"
message ""
stop

if arg-1 is "get":
if executor doesn't have permission "testperm.get":
message "{@NoPerm}"
stop
message ""
message "&4&l>------(&f&lTT&4&l)------<"
message ""
message "&7/TT get &c>>&7 ... &7[&cTest_Item&7, &cItem22&7]"
message ""
message "&4&l>------(&f&lTT&4&l)------<"
message ""
if arg-2 is "Test_Item":
give iron ingot named "&4&lTest-Item" with lore "&f&lThis it a Test-Item" to the player
message "&7You have recieved the powerfull &4&lTest-Item&7!"
if arg-2 is "Item2":
give gold ingot named "&4&lItem2" with lore "&f&lThis is a Item2" to the player
message "&7You have recieved &4&lItem22&7!"

else if arg-1 is "give":
message "1-give-test"
message "2-give-test"
message "3-give-test"
message "4-give-test"
message "5-give-test"
message "6-give-test"
message "7-give-test"
if arg-2 is "test1":
message "TEST1 WORKS"
if arg-2 is "test2":
message "TEST2 WORKS"
 

Attachments

  • upload_2021-1-4_9-17-5.png
    upload_2021-1-4_9-17-5.png
    43.4 KB · Views: 95
Im confused here what are you trying to do?
I am making a command named /TT. The command has multiple arguments-1's, "get" and "give". After you put in the arg-1 named "get", you get a new message, after which you can include the second argument, to recieve an item.

With the arg-1 named "give", the command still works fine. Only when you add an arg-2 following the "give arg-1", it will show the correct message, but also the arg-1 output, which it should not show becouse I have put in the second argument already.

The Code following the first arg-1 and the second arg-1 are the same, though the arg-2's behind the second arg-1 command give a different output.

(I hope I am speaking clear enough here)

upload_2021-1-4_10-47-19.png


This picture above ^^ Shows what the output is per command

upload_2021-1-4_10-47-58.png


And this picture above here ^^ show what outputs should not be given. (the red lines indicate what outputs should not be send)
 
Status
Not open for further replies.