Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Why is there an error in the Zednov Tycoon Kit?

Asked by 2 years ago
Edited 2 years ago

I have a problem with the Zednov Tycoon kit, the problem is at line 20, it says that its in infinite yield, I think meaning that it cannot find the button in the PurchasedObjects folder, but I can't find how to fix it!

for i,v in pairs(script.Parent.Buttons:GetChildren()) do
        spawn(function()
        if v:FindFirstChild("Head") then

            local ThingMade = script.Parent.Purchases:WaitForChild(v.Object.Value)
            if ThingMade ~= nil then
                Objects[ThingMade.Name] = ThingMade:Clone()
                ThingMade:Destroy()
            else
                --//Button doesn't have object, remove it
                error('Object missing for button: '..v.Name..', button has been removed')
                v.Head.CanCollide = false
                v.Head.Transparency = 1
            end

            if v:FindFirstChild("Dependency") then --// if button needs something unlocked before it pops up
                v.Head.CanCollide = false
                v.Head.Transparency = 1
                coroutine.resume(coroutine.create(function()
                    if script.Parent.PurchasedObjects:WaitForChild(v.Dependency.Value) then
                        if Settings['ButtonsFadeIn'] then
                            for i=1,20 do
                                wait(Settings['FadeInTime']/20)
                                v.Head.Transparency = v.Head.Transparency - 0.05
                            end
                        end
                        v.Head.CanCollide = true
                        v.Head.Transparency = 0
                    end
                end))
            end

            v.Head.Touched:connect(function(hit)
                local player = game.Players:GetPlayerFromCharacter(hit.Parent)
                if v.Head.CanCollide == true then
                    if player ~= nil then
                        if script.Parent.Owner.Value == player then
                            if hit.Parent:FindFirstChild("Humanoid") then
                                if hit.Parent.Humanoid.Health > 0 then
                                    local PlayerStats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
                                    if PlayerStats ~= nil then
                                        if (v:FindFirstChild('Gamepass')) and (v.Gamepass.Value >= 1) then
                                            if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,v.Gamepass.Value) then
                                                Purchase({[1] = v.Price.Value,[2] = v,[3] = PlayerStats})
                                            else
                                                game:GetService('MarketplaceService'):PromptPurchase(player,v.Gamepass.Value)
                                            end
                                        elseif (v:FindFirstChild('DevProduct')) and (v.DevProduct.Value >= 1) then
                                            game:GetService('MarketplaceService'):PromptProductPurchase(player,v.DevProduct.Value)
                                        elseif PlayerStats.Value >= v.Price.Value then
                                            Purchase({[1] = v.Price.Value,[2] = v,[3] = PlayerStats})
                                            Sound(v, Settings.Sounds.Purchase)
                                        else
                                            Sound(v, Settings.Sounds.ErrorBuy)
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end)
            end
        end)
    end

2 answers

Log in to vote
0
Answered by 2 years ago

is there a Dependency in all of ur buttons?

0
There is a dependency in each one except the start working one. JJayxx_123 1 — 2y
0
The infinite yield doesn't allow me to buy walls that you are supposed to be able to buy right when you begin working JJayxx_123 1 — 2y
0
wot if u make it if script.Parent.PurchasedObjects.v.Depencency.Value then BulletproofVast 1033 — 2y
0
That just makes it so I can only buy the Start Working dropper. JJayxx_123 1 — 2y
Ad
Log in to vote
0
Answered by
xxaxxaz 42
2 years ago
Edited 2 years ago

idk, when I used youthe kit I just followed the tutorial. I did not enteract with the scripts.

if I where in you'r posistion I would just delete it and start again but this time with the tutorial. it is best to learn with seeing something.

0
I didn't interact with the scripts either, I just changed the buttons and purchases JJayxx_123 1 — 2y
0
hmmm. try deleting it and opening it again. then try following the tutorials xxaxxaz 42 — 2y

Answer this question