#Tycoon New Buttons Showing Up

1 messages · Page 1 of 1 (latest)

tired idol
#

IMG 1 = The Problem
IMG 2 = The Script Output
IMG 3 = The Viewport

My Core Script = https://pastebin.com/hCNVSmGx

I'm adding buttons to my tycoon, but for some reason the newer buttons are popping up, which makes me think that the dependencies don't work. But those are input just fine.
Upon looking into the Output it seems like it says Infinite yield possible on 'Workspace.Tycoons.Tycoon.PurchasedItems:WaitForChild("Dropper[NUMBER]")' for every dropper number, besides for dropper 11, and dropper 14. Which does make sense, because theyre the buttons before the ones that don't work. But that's the furthest that I got. If you want to see any values, or anything else that I input, feel free to ask and I'll gladly show you.
Any help is greatly appreciated, thank you in advance!

granite jewel
hearty owlBOT
#

studio** You are now Level 2! **studio

granite jewel
# tired idol

You are searching for ("Dropper"..number) and their names are: ("ButtonDropper"..number)

#

Is this on purpose?

tired idol
#

Yes, ("Dropper"..number) is in PurchasedItems

granite jewel
tired idol
#
if buttons then
    for i, v in pairs(buttons:GetChildren()) do
        spawn(function()
            if v:FindFirstChild("Button") then

                local newObject = purchasedItems:FindFirstChild(v.Object.Value)
                if newObject ~= nil then
                    objects[newObject.Name] = newObject:Clone()
                    newObject:Destroy()
                else
                    v:Destroy()
                end

                if v:FindFirstChild("Dependency") then
                    v.Button.Transparency = 1
                    v.Button.CanCollide = false
                    v.Button.BillboardGui.Enabled = false
                    coroutine.resume(coroutine.create(function()
                        if purchasedItems:WaitForChild(v.Dependency.Value) then
                            v.Button.Transparency = 0
                            v.Button.CanCollide = true
                            v.Button.BillboardGui.Enabled = true
                        end
                    end))
                end

                v.Button.Touched:Connect(function(hit)
                    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
                    if player then
                        if values.OwnerValue.Value == player then
                            if v.Button.CanCollide == true then
                                if player:FindFirstChild("leaderstats").Cash.Value >= v.Price.Value then
                                    player.leaderstats.Cash.Value -= v.Price.Value
                                    objects[v.Object.Value].Parent = purchasedItems
                                    v:Destroy()
                                end
                            end
                        end
                    end
                end)
            end
        end)
    end
end
tired idol
rose stratus
#

bruh you dont even need to read any of the script, the issue is that either the objects in PurchasedItems are misspelled or do not exist

#

check to see how the objects in Purchaseditems are spelled

#

or just send us a picture

#

this looks like the error line if purchasedItems:WaitForChild(v.Dependency.Value) then

rose stratus
#

print ((v.Dependency.Value))

#

i do not think the courtine is nesscary

tired idol
#

so remove line 48?

rose stratus
#

if it works id not remove it,i just want the inital issue fixed first

tired idol
#

it works for every other button, just not those three which is weird

#

do you have any ideas?

tired idol
#

@rose stratus?

rose stratus
#

oh uh honestly i thought @hidden cove would come haha

#

i guess he living his life rn

tired idol
# hidden cove Gimme a sec man

im not trying to sound impatient or anything but when do you think you'll have time to help? its so i'll know when to come back to this thread

uncut brook
hearty owlBOT
#

studio** You are now Level 1! **studio