I am running into an issue where frames that I am cloning from a server script onto a player’s gui will not actually replicate onto the client. Below in a server script I have a list of tools that are used as frame names inside a Player’s Gui. When I test my game only the server recognizes that there are new frames, however, the local script will not print out any of these new frames that I have created.
What could I be doing wrong here?
LOCAL SCRIPT:
for _,v in pairs(list:GetChildren()) do
if v:IsA("Frame") then
print(v.Name)
end
end
SERVER:
local tools = {
["Hack"] = 5;
["Food tray"] = 1;
["Permit"] = 2;
}
for tool, price in pairs(tools) do
if game.ReplicatedStorage.Stats.Storage.Tools:FindFirstChild(tostring(tool)) ~= nil then
local newframe = newGui.Frame.List.ItemsFrame.ItemFrame:Clone()
newframe.Parent = newGui.Frame.List.ItemsFrame
newframe.ItemName.Text = tostring(tool)
newframe.Credits.Text = price
newframe.Visible = true
end
end
for _,v in pairs(newGui.Frame.List.ItemsFrame:GetChildren()) do
print(v.Name)
end
Sever output:
UIListLayout
ItemFrame (x4)
Client output:
ItemFrame – (there is originally one frame that I use as a template and this is what I am cloning)