What I want to do is rename a mesh part in player's inventory folder for further use, but despite everything being pretty simple I get this:
"Carpet is not a valid member of Players.lazolv.Inventory.Items.Slot1"
It is a client side error and the script I use is a local script in a gui frame
-- there are some variables but all their names should be explaining what do they mean
if Items.Slot1:FindFirstChild("Carpet") and inventory.Equipment.ESlot2:FindFirstChild("PlasticBag") then
script.Parent.TextBox.Sound2:Play()
wait(3)
Items.Slot1.Carpet.Name = "DryCarpet"
ItemFrame.ImageLabel.Image = "rbxassetid://6116102064"
ItemFrame.TextBox.Text = "Press Y to drop or carry this garbage"
ItemFrame.Sample.Text = "Dry carpet"
print(Items.Slot1.Carpet.Name.." is the name of the thing")
Items.Slot1.Carpet.Name = "DryCarpet"
end
Once it reaches the name part I see the error, the print line makes it print item name in output. The funny thing is that it says the required item doesnt exist despite printing its name a moment earlier lol
[my own thoughtsbe like: "why yes I say that the sky is blue and deny it a moment later" - roblox lua]

2 comments
can you format your code?
formatted