It says in the output that i am trying to index nil with price in this, the error is on line 7 help pls.
game.Players.PlayerAdded:Connect (function(player) local pg = player:WaitForChild('PlayerGui') local Main = pg:WaitForChild('Main') for i , v in pairs(Main.PetShop.ScrollingFrame:GetChildren()) do if v.Name ~= 'Template' and v:IsA('Frame') then v.PetPrice.Text= game.ReplicatedStorage:WaitForChild('Pets'):FindFirstChild(v.Name).Price.Value v.PetName.Text = game.ReplicatedStorage:WaitForChild('Pets'):FindFirstChild(v.Name).Name end end end)
instead of:
v.PetPrice.Text= game.ReplicatedStorage:WaitForChild('Pets'):FindFirstChild(v.Name).Price.Value
do this:
v.PetPrice.Text= game.ReplicatedStorage:WaitForChild('Pets'):FindFirstChild(v.Name.Price).Value