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

Hi, Im Making A Tycoon Kit But I Have Problem with in pairs.So i need from you some help pwease???

Asked by 2 years ago
local Object = workspace.TycoonKitV2.Purchase:WaitForChild(script.Parent.Parent.Parent.Parent:GetAttribute("Object"))
script.Parent.Text = script.Parent.Parent.Parent.Parent:GetAttribute("Object").." "..script.Parent.Parent.Parent.Parent:GetAttribute("Cost").."€"
script.Parent.Font = script.Parent.Parent.Parent.Parent.Parent.Parent:GetAttribute("Font")
for index, descendant in pairs(workspace.TycoonKitV2.Purchase:WaitForChild(script.Parent.Parent.Parent.Parent:GetAttribute("Object")):GetDescendants()) do
    print(descendant.Name)
end
for index, descendant in pairs(workspace.TycoonKitV2.Purchase:WaitForChild(script.Parent.Parent.Parent.Parent:GetAttribute("Object")):GetDescendants()) do
    print(descendant.Name)
    if descendant:IsA("BasePart") then
        print("Base")
        local Transy = descendant.Transparency  
        descendant.Transparency = 1
        while true do
            if Object.Parent == workspace.TycoonKitV2.Purchased then
                descendant.Transparency = Transy
            end
            wait(0.1)
        end
    elseif descendant:IsA("TextLabel") then
        local Transy = descendant.Transparency  
        descendant.Transparency = 1 
        while true do
            if Object.Parent == workspace.TycoonKitV2.Purchased then
                descendant.Transparency = Transy
            end
            wait(0.1)
        end
    elseif descendant:IsA("Part") then
        local Transy = descendant.Transparency  
        descendant.Transparency = 1 
        while true do
            if Object.Parent == workspace.TycoonKitV2.Purchased then
                descendant.Transparency = Transy
            end
            wait(0.1)
        end
    end
end
0
What exactly do you need help with imKirda 4491 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

The Main Problem is the 4Line is printing everything 7Line is printing only One Part :/

0
Theres a while loop inside the for loop that will never stop. "While true" runs forever unless its stopped with "break", so maybe replace the "true" with the objects transparency or switch the full while loop to a repeat loop WoTrox 345 — 2y
0
Please post itas Answear DefinitelyNotTronix 19 — 2y
Ad

Answer this question