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

How do I change values of a Object whos name has spaces?

I'm making a player's limbs disappear so I'm editing transparency. Because all the limbs have spaces in them in the name in properties, I can edit them.

Example: It keeps doing this - ["Right Arm"] script.Parent.Mannequin.Opponent["Right Arm"].Transparency = 1

4 comments

0

player's limbs don't have spaces in them though

0

that's R6. hardly anybody uses that anymore https://gyazo.com/794a5085d0a4b59d84a76cd00e08c712

0

am old fashioned.

1 answer

In a Local Script:

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait() 
 --you may want to wait some before looping to allow parts to load
for _,v in pairs(char:GetChildren()) do
   if v.Name:match("%s") and v:IsA("BasePart") then --the string pattern for whitespace
      v.Transparency = 1
   end
end

String Patterns

1 comment

0

I'm not trying to edit the local player. Its a Humanoid NPC

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