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

is there a way to use a object with space in a script?

i have a script that tries to change a characters arm colour (it doesn't come with the normal change colour block so i change them through the arms)

script.parent.parent.parent.parent.parent.Left Arm.Color = 253, 234, 141

but it errors cause it has a space in a script; how do i fix?

2 answers

✓ Accepted answer

If you want to reference something that has a space in between it, use this:

script.Parent.Parent.Parent.Parent.Parent["Left Arm"].Color = Color3.fromRGB(253, 234, 141)

You should also use Color3.fromRGB

3 comments

0

i now get error color3 doesent exist

0

oh i fixed it u didnt need the first color3 only the second

0

Oh right lol

You can't set colors to 3 numbers, that would just error. Instead, use Color3.fromRGB. If you didn't use Color3, it would try to set a color3 value to a number, and ROBLOX doesn't like that. The difference between Color3.fromRGB and Color3.new is that Color3.fromRGB is from 1 to 255, when Color3.new goes from 0 to 1. Hope this helped! And, ps, don't use parent but use Parent.

1 comment

0

thats not what i meant i need to change object "Left Arm" but i cant cause it has a space in it how do i bypass that?

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