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

changing the parent of a script that has spaces?

I'm trying to move a script in Lighting using a script. The item is called CS SCRIPT that I'm trying to move.

I've tried

game.Lighting.Stuff.CS.["CS SCRIPT"].Parent = game.Workspace

but it doesn't work. I think it's because there is a space in CS SCRIPT

I thought that when you want to say stuff in a game that has spaces in it you have to put [" "] around it. it doesn't work without the [" "] too, i tried

game.Lighting.Stuff.CS.CS SCRIPT.Parent = game.Workspace

but it didn't work.

1 comment

1 answer

✓ Accepted answer

The correct syntax is: game.Lighting.Stuff.CS["CS SCRIPT"]

Notice how there is no period before the opening square bracket.

4 comments

0

so would this work: game.Lighting.Stuff["C SPACE"]["CS SCRIPT"]

0

Yes, it should. Also, if this helped, please don't forget to mark my answer as accepted and optionally upvote. It helps us both. :)

0

By the way, you shouldn't use Lighting with any new work. You should instead use ServerScriptService and ServerStorage.

0

Try hard.

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