for i, v in pairs(button:GetChildren()) do
if v:FindFirstChild("Dependency") then --this line
v.BuyButton.Transparency = 1
v.BuyButton.CanCollide = false
v.AttemptBuy.Value = false
print(v) --until here
else
while true do
for j, l in pairs(button:GetChildren()) do
if l.AttemptBuy.Value == true then
l.BuyButton.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not owner.Value then
return
end
print(player.Name)
for i, v in pairs(FurnitureTable) do
if v.Name == l.Purchase.Value then
if l.AttemptBuy.Value == true then
if player.name == owner.Value.Name then
local leaderstat = player:WaitForChild("leaderstats")
local money = leaderstat:WaitForChild("Money")
local cost = l.Cost.Value
if money.Value >= cost then
l.BuyButton.Parent:Destroy()
v.Parent = PurchasedItem
for n, m in pairs(v:GetChildren()) do
local oriPm = m.Position
local oriPx = m.Position.x
local oriPy = m.Position.y
local oriPz = m.Position.z
local results =
{
Transparency = 0;
Position = oriPm
}
local x = math.random(oriPx-15, oriPx+5)
local y = math.random(oriPy-1, oriPy+10)
local z = math.random(oriPz-5, oriPz+5)
m.Position = Vector3.new(x, y, z)
local Start = tweenS:Create(m, info, results)
wait()
Start:Play()
end
money.Value -= cost
for z, x in pairs(button:GetChildren()) do
if x:FindFirstChild("Dependency") then
if x.Dependency.Value == v.Name then
x.BuyButton.Transparency = 0
x.BuyButton.CanCollide = true
x.AttemptBuy.Value = true
print("1 done")
end
end
end
end
end
end
end
end
end)
end
end
wait()
end
end
end
i can confirm that the "Dependency" a name of a string value is in the folder. specifically this line here
if v:FindFirstChild("Dependency") then --this line
v.BuyButton.Transparency = 1
v.BuyButton.CanCollide = false
v.AttemptBuy.Value = false
print(v) --until here
