x = 0 bu = game.Workspace.Button1 bu.ClickDetector.MouseClick:Connect(function() x = x + 1 end) buy1 = script.Parent buy1.Touched:Connect(function() if x == 5 then buttony = game.Lighting.Button2:Clone() buttony.Parent = game.Workspace end end)
The script doesn't show any errors but it's not working. I tried figuring it out and I think the problem is in the "If x == 5 then".
I found the problem, when I was pressing the button. It has to be exactly 5 not >= 5. I pressed the button more than five and making it not work.