#Problems with billboardgui

1 messages · Page 1 of 1 (latest)

rancid jasper
#

Hi all!
My buttons for the billboardgui do not get created 50% of the time for whatever reasons. Any help is appreciated!

local BillboardGui = PlayerGui:WaitForChild("SellOptions");
BillboardGui.Adornee = SellNPC:WaitForChild("HumanoidRootPart"); --For whatever reason it doesn't work unless I add this
script.UIListLayout.Parent = BillboardGui;
for Number, Text in pairs(SellOptions) do
    
    local Clone = script.Button:Clone();
    Clone.Number.Text = string.format("#%s", Number);
    Clone.TextLabel.Text = string.format("%s", Text);
    Clone.Name = Number;
    
    Clone.Parent = BillboardGui;
    
    local HoverTween = TweenService:Create(
        Clone.TextLabel,
        TweenInfo.new(0.5),
        {
            Position = UDim2.new(0.1,0,0,0);
        }
    );

    local UnhoverTween = TweenService:Create(
        Clone.TextLabel,
        TweenInfo.new(0.25),
        {
            Position = UDim2.new(0.05,0,0,0);
        }
    );
    
    Clone.MouseButton1Click:Connect(function()

        SellFunctions[Number]();
    end);

    Clone.MouseEnter:Connect(function()

        HoverTween:Play();
    end);

    Clone.MouseLeave:Connect(function()

        UnhoverTween:Play();
    end);
end
sour arrow
#

"script.UIListLayout.Parent = BillboardGui" what.

rancid jasper
sour arrow
#

can you add this line just before the for loop?

repeat wait() until #SellOptions == 4

#

or nevermind, the for loop doesnt even run i think

trim hatchBOT
#

studio** You are now Level 12! **studio

sour arrow
#

so the table gets cleared or something

rancid jasper
rancid jasper
sour arrow
#

can you print index inside the for loop before cloning

#

so we know for sure it fails to create it instead of just not being able to create it

rancid jasper
#

omg...

trim hatchBOT
#

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

rancid jasper
#

i

#

restarted my studio

#

and it just

#

started working with no issue?

#

what?

#

i can't even get it to not work anymore

rancid jasper
#

thank you for the help :P

sour arrow
#

dont touch it if it works 👍

karmic saffronBOT
#

Shock!
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)