local Equip = script.Parent
local template = script.Parent.Parent.Parent.Parent.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EquipPet = ReplicatedStorage:WaitForChild("EquipPet")
Equip.MouseButton1Click:Connect(function() -- when player clicks Equip, the Equip is a Ui that prompts players
Equip.Text = "Equipped"
local EquippedValue = template:WaitForChild("EquippedValue")
EquippedValue.Value = "Equipped" -- value in template to store info
if EquippedValue.Value == "Equipped" then
template.check.BackgroundColor3 = Color3(82, 170, 55) -- this where the code errors
end
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")
EquipPet:FireServer()
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
EquipPet:FireServer()
end
end
end)
Players.mariyandog999.PlayerGui.Storage.template.Holder.PetDisplayFrame.Equip.EquipButton.LocalScript:15: attempt to call a table value
CHECK IS AN IMAGE BUTTON