This script seems to be working but with only some buttons.
What should the script do:
When you step on the button, another button should appear after.
local TycoonModel = script.Parent.Parent
local items = {}
local BoughtItems = TycoonModel:FindFirstChild("BoughtItems")
local Buttons = TycoonModel:FindFirstChild("Buttons")
local DropperParts = TycoonModel:FindFirstChild("DropperParts")
local Scripts = TycoonModel:FindFirstChild("Scripts")
local Values = TycoonModel:FindFirstChild("Values")
local mainItems = TycoonModel:FindFirstChild("MainItems")
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.Button.Transparency = 1
v.Button.CanCollide = false
v.Button.BillboardGui.TextLabel.Visible = false
end
if v:FindFirstChild("Dependency")then
coroutine.resume(coroutine.create(function()
v.Button.Transparency = 1
v.Button.CanCollide = false
v.Button.BillboardGui.TextLabel.Visible = false
if BoughtItems:WaitForChild(v.Dependency.Value, 111 ) then
v.Button.Transparency = 0
v.Button.CanCollide = true
v.Button.BillboardGui.TextLabel.Visible = true
end
end))
end
Thanks in advance!