Solved Quotation Marks inside of commands

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

    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!

VisoXD

New Member
Dec 22, 2023
7
0
1
I'm really new to Skript and this is my first script. I'm trying to make a /keyall command but I ran into a problem with quotation marks in commands, I tried fixing it myself, but didn't make it far.
Code:
command /keyall <number>:
 permission: command.keyall
 usage: /keyall amount
 trigger:
  command "bc &dThe &5&lKeyall&r&d will start in &5&l30 seconds&r&d, make sure you have atleast &5&lone empty inventory slot&r&d!" and "/title @a title {"text":"Keyall in 30s","color":"dark_purple","bold":true}"
  wait 30 seconds
  command "crate giveall Keyall %argument 1%" and "bc &dYou can &5&luse&r&d your key at &5&lspawn&r&d (/spawn)!"
The problem is in line 5, in the /title command (as already mentioned because of the quotation marks inside the command). If anyone knows how to solve this problem, please reply with a fix.
PS: The rest of the script works.
Thanks!
 
Last edited by a moderator:
You need to double up the speech marks, like this:
Code:
command /keyall <number>:
 permission: command.keyall
 usage: /keyall amount
 trigger:
  command "bc &dThe &5&lKeyall&r&d will start in &5&l30 seconds&r&d, make sure you have atleast &5&lone empty inventory slot&r&d!" and "/title @a title {""text"":""Keyall in 30s"",""color"":""dark_purple"",""bold"":true}"
  wait 30 seconds
  command "crate giveall Keyall %argument 1%" and "bc &dYou can &5&luse&r&d your key at &5&lspawn&r&d (/spawn)!"
 
You need to double up the speech marks, like this:
Code:
command /keyall <number>:
 permission: command.keyall
 usage: /keyall amount
 trigger:
  command "bc &dThe &5&lKeyall&r&d will start in &5&l30 seconds&r&d, make sure you have atleast &5&lone empty inventory slot&r&d!" and "/title @a title {""text"":""Keyall in 30s"",""color"":""dark_purple"",""bold"":true}"
  wait 30 seconds
  command "crate giveall Keyall %argument 1%" and "bc &dYou can &5&luse&r&d your key at &5&lspawn&r&d (/spawn)!"
Thank you so much, I actually saw the tip: "double the quotation marks" before but I thought they meant it like this:
""/title @a title {"text":"Keyall in 30s","color":"dark_purple","bold":true}""
Thanks for helping me out, I really, really appreciate it!