Hi! I would like to clone an already made UI object located in the ServerStorage. But everytime I try to clone it and modify it’s properties. I get a “no found” error. When checking the explorer I’ve just noticed the object has all of it’s descendants missing.
The objects are all marked as archivable, so I don’t know if I’m missing something.
Here is the complete code and some screenshots.
--DOCS
--https://devforum.roblox.com/t/what-are-tuples/550711
--Services
Players = game:GetService("Players")
ServerStorage = game:GetService("ServerStorage")
ServerScriptService = game:GetService("ServerScriptService")
CollectionService = game:GetService("CollectionService")
--Modules
DatabaseModule = require(ServerScriptService.DatabaseModule)
--References
playerDonationFrameTemplate = ServerStorage.UI.PlayerDonationFrame
playersScrollingFrame = script.Parent.ScrollingFrame
--Variables
topDonatorPlayers = {}
topDonatorRobux = {}
--Refresh the UI deleting old frame and replacing them with new ones with updated info
function RefreshUI()
--Refresh Info
topDonatorPlayers, topDonatorRobux = DatabaseModule.GetTopDonators()
--Destroy all the old frames
local oldFrames = CollectionService:GetTagged("PlayerDonationFrameUI")
for i, frame in ipairs(oldFrames) do
frame:Destroy()
end
--Create new frames
for i, donatorId in ipairs(topDonatorPlayers) do
local newFrame = playerDonationFrameTemplate:Clone()
newFrame.Parent = playersScrollingFrame
newFrame.PlayerText.Text = Players:GetPlayerByUserId(donatorId).Name
newFrame.RobuxText.Text = topDonatorRobux(i)
newFrame.PlayerImage.Image = Players:GetUserThumbnailAsync(donatorId, Enum.ThumbnailType.HeadShot)
end
end
while true do
wait(3)
RefreshUI()
wait(8)
end
How it should look
How it actually looks after cloned
As you can see all the childs of the object are missing.
Here’s the error:
06:47:59.901 PlayerText is not a valid member of Frame "Workspace.GlobalBillboard.DonationsBoard.SurfaceGui.ParentFrame.PlayersFrame.ScrollingFrame.PlayerDonationFrame" - Server - TopDonatorsLogic:44
06:47:59.901 Stack Begin - Studio
06:47:59.901 Script 'Workspace.GlobalBillboard.DonationsBoard.SurfaceGui.ParentFrame.PlayersFrame.TopDonatorsLogic', Line 44 - function RefreshUI - Studio - TopDonatorsLogic:44
06:47:59.901 Script 'Workspace.GlobalBillboard.DonationsBoard.SurfaceGui.ParentFrame.PlayersFrame.TopDonatorsLogic', Line 56 - Studio - TopDonatorsLogic:56
06:47:59.901 Stack End - Studio
Any help is appreciated