Errror: Inventory is not a valid member of PlayerGui “Players.mariyandog999.PlayerGui” - Client - LocalScript:5
Its right there tho
Local Script
local Equip = script.Parent
local template = script.Parent.Parent.Parent.Parent.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EquipPet = ReplicatedStorage:WaitForChild("EquipPet")
local Inventory = game.Players.LocalPlayer.PlayerGui.Inventory
local AmountEquipped = Inventory.LowerInvFrame.AmountEquipped
local amountEquippedValue = AmountEquipped.AmountEquippedValue
Equip.MouseButton1Click:Connect(function() -- when player clicks Equip, the Equip is a Ui that prompts players
Equip.Text = "Equipped"
amountEquippedValue.Value = amountEquippedValue.Value + 1
local EquippedValue = template:WaitForChild("EquippedValue")
EquippedValue.Value = "Equipped" -- value in template to store info
template.check.ImageColor3 = Color3.fromRGB(82, 170, 55)
for _, child in pairs(template:GetChildren()) do -- checking all children of template
if child:IsA("Folder") and child.Name == "Cat" then
print("Cat is a valid child of template")
local pet = child.Name
EquipPet:FireServer(pet)
wait(0.1)
child:Destroy()-- to stop the remote event from firing
elseif child:IsA("Folder") and child.Name == "Dog" then -- confirming that child is the Dog
print("Dog is a valid child of template") -- this is print statement i am talking about
local pet = child.Name
EquipPet:FireServer(pet)
wait(0.1)
child:Destroy()
end
end
end)