I am scripting a tycoon and I am implementing dependencies to the buttons. I have the dependency values in the buttons set. It doesn't give out any errors, but it still doesn't work.
It makes of all of the buttons except for the first one disappear(which is what I want), but when I buy it, the other buttons don't appear. To make it disappear, I changed the transparency to 1 and the can collide to false.
There is a ServerScript in the tycoon folder that handles the buttons and the dependencies.
For the dependencies, I'm using coroutine.resume(coroutine.create(function(), but for some reason, it doesn't work. Can anyone explain why, or what I should use, please? Thanks.
Here is the code: (this is just part of the script, but the whole part that handles the dependencies.)
if v:FindFirstChild("Dependency") then
v.Head.CanCollide = false
v.Head.Transparency = 1
coroutine.resume(coroutine.create(function()
if script.Parent.PurchasedItems:WaitForChild(v.Dependency.Value) then
v.Head.CanCollide = true
v.Head.Transparency = 0
end
end))
end
Any help is appreciated.

2 comments
on line 5, you should change :WaitForChild() to :FindFirstChild()
If you want a full explanation on how it works check out my answer, it teaches you how to implement the function in daily coding.