for i, v in pairs(Buttons:GetChildren()) do
local NewItem = BoughtItems:FindFirstChild(v.Item.Value)
if NewItem ~= nil then
Items[NewItem.Name] = NewItem:Clone()
NewItem:Destroy()
else
v.ButtonPart.Transparency = 1
v.ButtonPart.CanCollide = false
v.ButtonPart.BillboardGui.Frame.Visible = false
end
if v:FindFirstChild("Dependency") then
coroutine.resume(coroutine.create(function()
v.ButtonPart.Transparency = 1
v.ButtonPart.CanCollide = false
v.ButtonPart.BillboardGui.Frame.Visible = false
if BoughtItems:WaitForChild(v.Dependency.Value, 1000000) then
v.ButtonPart.Transparency = 0
v.ButtonPart.CanCollide = true
v.ButtonPart.BillboardGui.Frame.Visible = true
end
end))
end
v.ButtonPart["Top"].Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Values.OwnerValue.Value == player then
if v.ButtonPart.CanCollide == true and v.ButtonPart.Transparency == 0 then
if player:WaitForChild("leaderstats").Cash.Value >= v.Price.Value then
player.leaderstats.Cash.Value -= v.Price.Value
Items[v.Item.Value].Parent = BoughtItems
v:Destroy()
end
end
end
end
end)
end
okay so change this too if v.ButtonPart.CanCollide == true and v.ButtonPart.Transparency == 0 then
to if v.ButtonPart.Top.CanCollide == true and v.ButtonPart.Top.Transparency == 0 then