#Need help with scrolling frame

1 messages · Page 1 of 1 (latest)

normal cypress
#

if ui.graphLimiteds then
local template = ui.graphLimiteds.Template
local count = #playerData.limiteds -- Gets limited frame amount

    -- Get item dimensions from template
    local itemHeight = template.Size.Y.Scale
    local spacing = 0.01

    -- Calculate total content height needed
    local totalContentHeight = count * itemHeight + (count - 1) * spacing

    -- Set canvas size to fit all content
    ui.graphLimiteds.CanvasSize = UDim2.new(0, 0, totalContentHeight, 0)

    -- Control scrolling based on content
    if totalContentHeight <= 1 then
        -- Content fits, disable scrollbar
        ui.graphLimiteds.ScrollBarThickness = 0
        ui.graphLimiteds.ScrollingEnabled = false
    else
        -- Content doesn't fit, enable scrollbar
        ui.graphLimiteds.ScrollBarThickness = 12
        ui.graphLimiteds.ScrollingEnabled = true
    end
end

That's my script, I made it yesterday evening and idk what it does
it whould auto adjust the scrolling frame to be correct canvassize to dynamiaccly fit all contents correctly

heavy agate
#
  1. ai
#
  1. i dont think u even need it/most of it
#

auto canva size already does that

#

manually setting canva size was pre that

#

so no need to even do the canva size and calc

#

only real thing it does is this

#

hiding scroll if no elements

normal cypress
# heavy agate 1. ai

Woah! thanks!
Also how did you know it was AI?
tbh I've tried to learn scripting, but I understand very little, so I use claude for help a LOT
and thanks for the auto canva size Idek that existed.

heavy agate
heavy agate
normal cypress
heavy agate
#

or just docs