Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Text not including quotation marks on click. How do I fix this?

Im trying to make an executor for myself so I can ruin the experiences of people playing my games easily, and im trying to make a button that when you click it changes the text for the textbox. But whenever I do it, my name isn't inside quotation marks. Heres the script:

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Parent.TextBox.Text = "require(12345).new("..script.Parent.Parent.Parent.Parent.Parent.Parent.Name..")"
end)

The require is 12345 because the script is rare and unleaked. I'd suggest clicking view source because a small bug prevents you from seeing the whole script. Also the TextBox says this after I click the button, require(12345).new(Prxticles) With no quotations.

4 comments

0

script builder?

0

Sorta like that.

0

game.Players.LocalPlayer.Name

0

Oh. Obviously. String enclosures don't include the quotation characters. If you wish to use one, you can escape it, or use a different String constructor syntax.

3 answers

✓ Accepted answer

I'm not entirely sure what you're trying to do, but just so you know you don't need to wrap a require in quotes. This turns it into a string which.. well.. prevents it from requiring said item!

If the require returns a string, you don't need quotes at all.

Also, you can use a backslash to include quotes in quotes like so

print("He said \"Hello!\"")

Please correct me if I misunderstood you!

1 comment

0

I've accepted your answer as it is overall a better practice.

It's not on quotation marks because you're escaping the script making it do this

require().new() without ""

To add these you have to use [[ ]] to make a long string so you don't escape it

local str = ""
local name = "<Name>"
str = [[require(<AssetID>).new("]]..name..[[")]]

Implementing this to your script

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Parent.TextBox.Text = [[require(12345).new("]]..script.Parent.Parent.Parent.Parent.Parent.Parent.Name..[[")]]
end)

If this answered your question mark it as the answer!

1 comment

0

Thank you!

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Parent.TextBox.Text = [[require(12345).new(]]..script.Parent.Parent.Parent.Parent.Parent.Parent.Name..[[)]]
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.