Okay so i just created a script and it works fine but one little thing doesn't change and i don't know how to fix it and i don't know what the problem is really.. :/
Here is the code with the problem:
The problem is if i execute this command "/command (test1, test2, test3 or test4) 20.5" (the 20.5 is just an example) then it'll tell me "&cThis test does not exist!" even tho i did use argument 2 and i have tried changing it to this:
And i've also tried using this line:
But it didn't change anything, my guess is that it doesn't register arg-2 as set because it isn't an integer but how would i change that? Maybe changing the command from
to
and then use the line:
to check if it's an integer. That's one way i think will work but is there an easier way? :7
Thank you for reading my problem.
Here is the code with the problem:
code_language.skript:
Command /command [<text>] [<integer>]:
Permission: skript.command
Permission message: &cYou do not have permission to use this command!
Description: Test
Usage: /command <text> [integer]
Aliases: /cmd
Trigger:
if player is in world "world":
if arg-1 is not set:
message "&cArgument 1 needed!"
else:
if arg-1 is "Test1":
if arg-2 is not set:
message "&aTest1 works"
else:
if arg-2 is less than 0:
message "&cArgument 2 can't be lower than 0!"
else:
message "&cTest1 with argument 2 works"
else if arg-1 is "Test2":
if arg-2 is not set:
message "&aTest2 works"
else:
if arg-2 is less than 0:
message "&cArgument 2 can't be lower than 0!"
else:
set {variable} to arg-2
message "&aTest2 with argument 2 works"
else if arg-1 is "Test3":
if arg-2 is not set:
message "&aTest3 works"
else:
if arg-2 is less than 0:
message "&cArgument 2 can't be lower than 0!"
else:
set {variable} to arg-2
message "&aTest3 with argument 2 works"
else if arg-1 is "Test4":
if arg-2 is not set:
message "&aTest4 works"
else:
if arg-2 is less than 0:
message "&cArgument 2 can't be lower than 0!"
else:
set {variable} to arg-2
message "&aTest4 with argument 2 works"
else:
message "&cThis test does not exist!"
else:
message "&cThis command is only for world!"
code_language.skript:
else:
if arg-2 is not set:
message "&cThis test does not exist!"
else:
message "&cArgument 2 needs to be a number"
code_language.skript:
if arg-2 is not integer:
code_language.skript:
Command /command [<text>] [<integer>]:
code_language.skript:
Command /command [<text>] [<text>]:
code_language.skript:
if arg-2 is not integer:
Thank you for reading my problem.