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

guys, some character body parts has spaces, and my localscript doesnt work because of the spaces [?]

script.Parent.MouseButton1Click:Connect(function()
    game.Players.LocalPlayer.Character.["Right Arm"].BrickColor = BrickColor.new("Black")
    script.Parent.Parent.Parent.RIGHTARM.Text = "Black"
    script.Parent.Parent.Parent.RIGHTARM.BackgroundColor3 = Color3.fromRGB(27,42,53)
end)

a button that changes the right arm color, but it doesnt work because of the character, what is the problem?

4 comments

0
0

it didnt work

0

How about you try to remove the spaces in the name of the body part?

0

i cant do a script that changes the name of the body part, it doesnt work :/

1 answer

✓ Accepted answer

Change Character.["Right Arm"].BrickColor to Character["Right Arm"].BrickColor, removing the dot By using . you are signifying that you want to index something, but right after that you use [] signifying again that you want to index something. Lua doesn't like this, so it'll throw a syntax error.

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