✓ Accepted answer
If you know for a fact the object exists, you can use square brackets followed by a string value containing it's name (you can also index tables this way)
For example:
local Part = workspace["Part with spaces in name"]
FindFirstChild also works, but shouldn't really be used to just get something with spaces in the name. However, you should use this a lot if you don't know for certain it exists, because this can prevent your script from breaking. You can use it by calling it as a method on the object you're searching the object for:
local Part = workspace:FindFirstChild("Part with spaces in name")
Now, FindFirstChild is a function, so we can actually call it multiple ways. You've probably seen something like this before:
local Something = workspace:FindFirstChild("Part with spaces in name")
local Something2 = workspace:FindFirstChild"Part with spaces in name"
local Something3 = workspace:FindFirstChild'Part with spaces in name'
However, I'm not going to make this a answer about functions. Just thought that'd be some useful information, hope it helped.
1 comment
h.Parent:FindFirstChild("Left Leg") :D