Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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.

0
script builder? maumaumaumaumaumua 628 — 4y
0
Sorta like that. Prxticles 13 — 4y
0
game.Players.LocalPlayer.Name Ziffixture 6913 — 4y
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. Ziffixture 6913 — 4y

3 answers

Log in to vote
1
Answered by 4 years ago

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!

0
I've accepted your answer as it is overall a better practice. Ziffixture 6913 — 4y
Ad
Log in to vote
1
Answered by 4 years ago

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

require(<AssetID>).new(<PlayerName>) 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!

0
Thank you! Prxticles 13 — 4y
Log in to vote
-1
Answered by 4 years ago
script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Parent.TextBox.Text = [[require(12345).new(]]..script.Parent.Parent.Parent.Parent.Parent.Parent.Name..[[)]]
end)

Answer this question