As I've seen in many Tycoon games, many tycoon creators have actually managed to make a tycoon kit that has hidden buttons that appear after you buy something, but they never release it to the public! I've been trying to make a tycoon with that for a long time and have had to success at all. I've tried putting the button in the model that the previous button generates and edited the variables a bit. It would error and say the model is nil. I've tried making the button transparent and then do it...but nothing would happen. Not even any output! So I tried the first idea again and edited the wait time and it did the same as the second...? Here's my Tycoon button:
--lightpower26
--Some of these variables just make it easier for me to create my tycoon.
main = script.Parent.Parent
owner = main.Owner
button = script.Parent
name = "Walls"
price = 100
model = main:FindFirstChild("Walls")
normalname = "Purchase "..name.." for $"..price
text = button.BillboardGui.TextLabel
text.Text = normalname
backup = model:Clone()
Debounce = false
wait(1)
model:Destroy()
button.Click.MouseHoverEnter:connect(function(plr)
if plr.Name ~= owner.Value then return end
if plr.leaderstats.Cash.Value >= price then
text.TextColor3 = Color3.new(0, 1, 0)
text.TextStrokeColor3 = Color3.new(1, 1, 1)
text.Text = "Click to "..normalname
elseif plr.leaderstats.Cash.Value < price then
text.Text = "You need "..(price - plr.leaderstats.Cash.Value).." more Cash to purchase "..name.."!"
text.TextColor3 = Color3.new(1, 0, 0)
text.TextStrokeColor3 = Color3.new(1, 1, 1)
end
end)
button.Click.MouseHoverLeave:connect(function(plr)
if plr.Name ~= owner.Value then return end
text.Text = normalname
text.TextColor3 = Color3.new(1, 1, 1)
text.TextStrokeColor3 = Color3.new(0, 0, 0)
end)
button.Click.MouseClick:connect(function(plr)
if button.Transparency >= 0 then
if not Debounce then
if plr.Name ~= owner.Value then
Debounce = true
if owner.Value ~= "" then
text.Text = owner.Value.." owns this mine! Not you!"
elseif owner.Value == "" then
text.Text = "No one owns this mine!"
end
text.TextColor3 = Color3.new(1, 0, 0)
text.TextStrokeColor3 = Color3.new(1, 1, 1)
delay(0.5, function()
text.Text = normalname
text.TextColor3 = Color3.new(1, 1, 1)
text.TextStrokeColor3 = Color3.new(0, 0, 0)
end)
wait(0.5)
Debounce = false
return
end
if plr.leaderstats.Cash.Value < price then
Debounce = true
text.Text = "You need "..(price - plr.leaderstats.Cash.Value).." more Cash to purchase "..name.."!"
text.TextColor3 = Color3.new(1, 0, 0)
text.TextStrokeColor3 = Color3.new(1, 1, 1)
delay(0.5, function()
text.Text = normalname
text.TextColor3 = Color3.new(1, 1, 1)
text.TextStrokeColor3 = Color3.new(0, 0, 0)
end)
wait(0.5)
Debounce = false
return
end
Debounce = true
plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value-price
text.Text = "Purchasing..."
text.TextColor3 = Color3.new(0, 0, 1)
text.TextStrokeColor3 = Color3.new(1, 1, 1)
model = backup:Clone()
model.Parent = main
for i = 0, 1, 0.05 do
text.TextTransparency = i
text.TextStrokeTransparency = i
button.Transparency = i
wait()
end
game.ReplicatedStorage.ChatEvent:FireClient(plr, plr, "You have succesfully purchased "..normalname.."!")
wait(0.1)
Debounce = false
button:Destroy()
end
end
end)
Please help me! I've looked all over the internet and roblox forums (which no one looks at my posts...) for an answer!

2 comments
The script you provided is totally unrelated to your question. We can help you if you want to fix your failed scripts (by the way, check if it's disabled), but also isolate the problem as much you can and leave out unrealted code. You'll get an answer faster that way.
The script is my tycoon button...it isn't unrelated...I even motioned that.