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

How to I refer to an object that has spaces in its name?

Asked by 5 years ago
Edited 5 years ago

For example, if I wanted to clone a part it would be this:

game.Workspace.Part:Clone()

But what if I wanted to clone a part that had spaces in its name? Obviously,

game.Workspace.Part With Spaces:Clone()

wouldn't work. How do I refer to something that has spaces in its name?

1
game.Workspace["Part With Spaces"]:Clone() srimmbow 241 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Just to let you know, you didn't have to look this up. It's probably pretty easy to find but ill give you an answer anyways.

["PART WITH SPACES"] (Make sure to remove the period before the bracket, it is not needed)

That's how it would work. A bracket and some quotation marks. Hope this helped!

Ad

Answer this question