#Transfer Data + new Gui

1 messages · Page 1 of 1 (latest)

austere cape
#

So i have some data / values, and i already transfered it to another Script with my Module Script, so theres no Problem, but...

I have a Value Called "Videos" in my leaderstats, and everytime this is going up, the Value Saves. So i have some Values for Videos Value 1, Videos Value 2, etc.
And i need, that everytime the Value is going up, a new Frame is coming , theres a Label called Video1, Video2, etc. and if you click on it you see the Values

The thing is, i dont know how to make a new Frame everytime, because after Video10, it would be like too much, and i dont know, if you click on for example Video1 Frame, so you see all the data from there, and if you click on Video2 Frame you see all the data from this Video

austere cape
#
        local VideoData = require(ReplicatedStorage.ModuleScripts.VideoData)
        local VideoArchive = require(ReplicatedStorage.ModuleScripts.VideoArchive)
        
        local calculatedData = {
            luckBoost = luckBoost,
            videoLength = videoLength,
            watchTimePerUser = watchTimePerUser,
            totalWatchTime = totalWatchTime,
            subsGained = subsGained,
            viewsGained = viewsGained,
            subMoney = subMoney,
            viewMoney = viewMoney,
            totalGainedMoney = totalGainedMoney
        }
        
        VideoData:Set(calculatedData)
        
        local videoNumber = VideosValue.Value
        
        VideoArchive:SaveVideoData(videoNumber, VideoData:Get())

Thats the Script which Saves the Values from each Video with Modules

#
local player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local VideoArchive = require(ReplicatedStorage.ModuleScripts.VideoArchive)
local VideoData = require(ReplicatedStorage.ModuleScripts.VideoData)

local notShownValues = player:WaitForChild("notShownValues")
local VideosValue = notShownValues:WaitForChild("Videos")


VideosValue.Changed:Connect(function()
    task.wait(15)
    local videoNumber = VideosValue.Value
    local videoData = VideoArchive:GetVideoData(videoNumber)

    if videoData then
        print("Video " .. videoNumber .. " got " .. videoData.viewsGained .. " Views.")
    else
        print("No data for " .. videoNumber)
    end
end)

Thats the Script, where i get all the Values from each Video, and where i want to Clone a Frame everytime a new Video is created, then you can click on these Frames / Buttons and you see the Values, and so on

spring dome
#

Okay, so then what's the issue

#

cloning the frame?

austere cape
#

no thats not the problem

#

i know how to Clone the Frame and Click on it

#

but i dont know how to see, which Frame i clicked and get the Values shown

#

i can try to do it, one min

austere cape
#

should i use a Scrolling Frame?

spring dome
#

sure, and have size increase dynamically

#

there's a property for it

austere cape
#

is that in Scrolling Frame?

spring dome
#

the length of the frame

austere cape
#

yeah

#

ohh

#

damn thanks, didnt know that

spring dome
#

ofc

austere cape
#

Where can i find it under properties?

spring dome
#

Automatic Canvas Size

austere cape
#

ah okay

#

X, XY, Y?

spring dome
#

XY

ornate thornBOT
#

studio** You are now Level 6! **studio

austere cape
#

okay

spring dome
#

and set CanvasSize to all 0

austere cape
#

alr

#

should i call the Frames like "Video" ..Videos.Value

spring dome
#

up to you

#

are you using a gridlayout?

austere cape
#

should i Clone the Frame from the ReplicatedStorage to StarterGui or just clone it inside the StarterGui?

spring dome
#

clone from inside, otherwise it might bug the size and position of the frame

austere cape
#

okay

#

Should i make the "Clone Frame" invisible or just use the first Frame which i use as "Video1" and Clone this one / change Name / change Values?

spring dome
#

Have a template frame to keep things simple

austere cape
#

a template Frame inside StarterGui?

spring dome
#

yeah

austere cape
#

okay ty

#

hmm

#

when i have a Scrolling Frame --> UIGridLayout.
How can i make that the Frames at the Top are a bit under the Scrolling Frame?

#

i think i will use a UIListLayout

spring dome
#

I make a main frame and then the scrolling frame is inside with an invisible background

austere cape
#

thats good

austere cape
#

so uh

#

nvm it just wasnt visible

#

alrr @spring dome

#

it's working now, and i can see all the Values, but

#

one Value is not showing up

#

nvm now everything is working, i can see all the different Videos, etc.

#

thank you very much @spring dome

spring dome
#

np