So I’m a bit new to scripting and I was trying to setup a donation board up and while doing this I ran into an issue where only half of the developer products were showing up on the donation board, is there any reason why it would do this and what would you recommend me to do so I can fix this issue? There’s no errors in output
local module = {}
module.Products = {
{
ProductPrice = 5, --The price from the Developer Product.
ProductId = 1236741339 -- The ID from the Developer Product.
},
{
ProductPrice = 25, --The price from the Developer Product.
ProductId = 1236741360 -- The ID from the Developer Product.
},
{
ProductPrice = 100, --The price from the Developer Product.
ProductId = 1236741373 -- The ID from the Developer Product.
},
{
ProductPrice = 500, --The price from the Developer Product.
ProductId = 1236741390 -- The ID from the Developer Product.
},
{
ProductPrice = 1000, --The price from the Developer Product.
ProductId = 1236741425 -- The ID from the Developer Product.
},
{
ProductPrice = 5000, --The price from the Developer Product.
ProductId = 1236741443 -- The ID from the Developer Product.
},
{
ProductPrice = 10000, --The price from the Developer Product.
ProductId = 1236743985 -- The ID from the Developer Product.
},
{
ProductPrice = 20000, --The price from the Developer Product.
ProductId = 1236741461 -- The ID from the Developer Product.
},
{
ProductPrice = 30000, --The price from the Developer Product.
ProductId = 1236832212 -- The ID from the Developer Product.
},
{
ProductPrice = 40000, --The price from the Developer Product.
ProductId = 1236832265 -- The ID from the Developer Product.
},
{
ProductPrice = 50000, --The price from the Developer Product.
ProductId = 1236832280 -- The ID from the Developer Product.
},
}
return module
Well considering all we have access to is your table setup and a picture of the UI there isn’t much to go off of. There is an endless amount of things that could be occurring. Maybe you just have it set up to only have ui generated for a certain amount of elements with a loop of some sort due to a simple type.
Is there anything else you could provide us with.
Not sure if this is the script that you need, but this is the updater for the buttons.
repeat wait() until _G.DBLocked ~= nil
if _G.DBLocked == true then
script:Destroy()
return
end
local Products = require(script.Parent.Parent.Products).Products
function updateBoard(data)
for _,v in pairs (script.Parent.SurfaceGui.MainFrame.ScrollingFrame:GetChildren()) do
v:TweenPosition(UDim2.new(-1,0,0,v.Position.Y.Offset),'In','Quad',1,true)
wait()
delay(1,function()
v:Destroy()
end)
end
local n = 0
for k, v in pairs(data) do
local L = script.Frame:Clone()
L.Parent = script.Parent.SurfaceGui.MainFrame.ScrollingFrame
L.Title.Text = v.ProductPrice.." Robux"
L.Id.Value = v.ProductId
L.Position = UDim2.new(1,0,0,(n* 20) + (n*5))
L:TweenPosition(UDim2.new(0,0,0,(n* 20) + (n*5)),'In','Quad',1,true)
n = n + 1
script.Parent.SurfaceGui.MainFrame.ScrollingFrame.CanvasSize = UDim2.new(0,0,0,(n * 20) + (n*5))
end
end
updateBoard(Products)
I would probably start with some simply debugging. Acting a couple of prints within the creation loop could help you identify the issue. Also a wait could help you visualize what is happening.
for k, v in pairs(data) do
print(k .. ":" .. v)
local L = script.Frame:Clone()
L.Parent = script.Parent.SurfaceGui.MainFrame.ScrollingFrame
L.Title.Text = v.ProductPrice.." Robux"
L.Id.Value = v.ProductId
L.Position = UDim2.new(1,0,0,25*n)
L:TweenPosition(UDim2.new(0,0,0,25*n),'In','Quad',1,true)
n = n + 1
script.Parent.SurfaceGui.MainFrame.ScrollingFrame.CanvasSize = UDim2.new(0,0,0,25*n)
wait(.5)
end
print("Loop Done")
Without testing I just assume that some frames are simply going outside the bounds of the scrolling frame.
You were right about the buttons being out of bounds from the scrolling frame, I lowered the size and I was able to scroll through every developer product I added.
Thank you for the help!