So, I try to make a Logs GUI which puts a line by text while enlarging the scroll bar The problem is that, I don’t really know how to do it, I’m already try Absolute ContentSize but without success i found ContentSize but i don’t found how to use it
So this is the problem without Absolute CententSize
So the scrollbar don’t update but the line are good
The script
local BindableEvent = game.ReplicatedStorage:WaitForChild("MS"):WaitForChild("MSAddLog")
BindableEvent.Event:Connect(function(UserName, theCommand)
local StartCords = script.StartCords.Value -- 003
local StartCanvas = script.StartCanvas.Value -- 10
local TextSetNumber = script.TextSetNumber.Value -- is 10 is 18
local item = script.TextLabel:Clone()
item.Name = TextSetNumber
item.Text = UserName.." | "..theCommand
item.Position = UDim2.new(0,003,0,tonumber(StartCords))
item.Parent = script.Parent.Frame.ScrollingFrame
script.Parent.Frame.ScrollingFrame.CanvasSize = UDim2.new(0,0,StartCanvas,0)
script.StartCords.Value = tonumber(script.StartCords.Value + 28)
script.TextSetNumber.Value = script.TextSetNumber.Value + 1
if TextSetNumber > 18 then
script.StartCanvas.Value = script.StartCanvas.Value + 0.5
end
end)
--game.ReplicatedStorage.MSAddLog:Fire("Med367367","test")
And this is the error with my frist try, the line are not good and the scrollGui just don’t update
local BindableEvent = game.ReplicatedStorage:WaitForChild("MS"):WaitForChild("MSAddLog")
local grid = Instance.new("UIGridLayout")
grid.CellPadding = UDim2.new(0, 0, 0, 0)
grid.CellSize = UDim2.new(0, 100, 0, 100)
grid.Parent = script.Parent.Frame.ScrollingFrame
local function onContentSizeChanged()
local absoluteSize = grid.AbsoluteContentSize
script.Parent.Frame.ScrollingFrame.CanvasSize = UDim2.new(0, absoluteSize.X, 0, absoluteSize.Y)
end
grid:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(onContentSizeChanged)
BindableEvent.Event:Connect(function(UserName, theCommand)
local StartCords = script.StartCords.Value -- 003
local StartCanvas = script.StartCanvas.Value -- 10
local TextSetNumber = script.TextSetNumber.Value -- is 10 is 18
local item = script.TextLabel:Clone()
item.Name = TextSetNumber
item.Text = UserName.." | "..theCommand
--item.Position = UDim2.new(0,003,0,tonumber(StartCords))
item.Parent = script.Parent.Frame.ScrollingFrame
--script.Parent.Frame.ScrollingFrame.CanvasSize = UDim2.new(0,0,StartCanvas,0)
--script.StartCords.Value = tonumber(script.StartCords.Value + 28)
script.TextSetNumber.Value = script.TextSetNumber.Value + 1
--if TextSetNumber > 18 then
-- script.StartCanvas.Value = script.StartCanvas.Value + 0.5
--end
end)
--game.ReplicatedStorage.MSAddLog:Fire("Med367367","test")