I'm making a custom Leaderboard GUI. ChildAdded event is not firing. Output reads 1. Neither 2 or 3 appear.
local Player = game:GetService('Players').LocalPlayer local PlayerGui = Player:WaitForChild('PlayerGui') local Frame = PlayerGui.Leaderboard.Frame print(1) local function IncreaseFrame() print(2) if Frame.Size.Y.Offset < 245 then print(3) Frame.Size.Y.Offset = Frame.Size.Y.Offset + 20 end end Frame.ChildAdded:Connect(IncreaseFrame)
Here is the code which adds a TextLabel to Frame on player join (same script):
local TL = Instance.new('TextLabel') TL.Name = Player.Name TL.Text = Player.Name TL.AnchorPoint = Vector2.new(0.5,0) TL.Position = Frame.User.Position TL.Size = Frame.User.Size TL.TextSize = 16 TL.TextStrokeTransparency = 0.5 TL.Font = Enum.Font.GothamSemibold TL.BackgroundTransparency = 1 TL.TextColor3 = Color3.fromRGB(255,255,255) TL.TextXAlignment = Enum.TextXAlignment.Left TL.Parent = Frame -- THIS SHOULD FIRE CHILDADDED