The title says it all. I didn’t wanna ask help but… I’m so confused. Like I have no clue of why it isn’t working and what should I do. This is the line of code:
local rp = game:GetService("ReplicatedStorage")
local hairs = rp:GetChildren()
for i,v in pairs(hairs) do
if v:IsA("Accessory") then --this is line 142, the one from the error
v.Handle.BrickColor = BrickColor.new("Black")
end
end
I should also say that I used the same exact line in another piece of code (I did copy and paste), and it works just perfectly. So… what’s wrong here?
Make sure you have put the item inside the ReplicatedStorage
Make a folder inside of ReplicatedStorage and put the hair inside the folder.
local rp = game:GetService("ReplicatedStorage")
local hairs = rp.Folder:GetChildren() -- change this to the name of your folder
for i,v in pairs(hairs) do
if v:IsA("Accessory") then --this is line 142, the one from the error
v.Handle.BrickColor = BrickColor.new("Black")
end
end
Alright, it’s a bug for real I guess. Anyways, your solution worked. Thank you my guy. I hope Roblox fixes that before people break their scripts for a dumb bug.
As you can see, I did put them into ReplicatedStorage. Using a folder results in the same error. As I said in my original post, it works fine in other lines of code. That’s what is concerning me.