I've tried quotes and apostrophes.
I want to make it so script.Parent.Parent.Seasoner - 1200 has the Seasoner - 1200 Identified as a model.
Edit: I know I can change the name but I don't want to, for neatness purposes, it's a tycoon.
I've tried quotes and apostrophes.
I want to make it so script.Parent.Parent.Seasoner - 1200 has the Seasoner - 1200 Identified as a model.
Edit: I know I can change the name but I don't want to, for neatness purposes, it's a tycoon.
You can use square brackets to contain a name with spaces into a string. So for example, you can do ["Seasoner - 1200"] to get the object with that name.
Example:
script.Parent.Parent["Seasoner - 1200"] --Notice how there's no dot after the Parent before the "Seasoner - 1200" in square brackets. Treat the class structure as a table for names with spaces.
Also, this works for names without spaces, variables, etc.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
This question has already been answered here: https://scriptinghelpers.org/questions/11308/