Hi all, I don’t really know how to explain this but I’m trying to clone a SurfaceGUI to go into all the children found using i,v in pairs. So far I’ve had some luck but it’s only going into 1, not all of them. Does anyone know a solution to this?
function module.HttpError()
local Controllers = script.Parent.Parent.Parent.Controllers:GetChildren()
local UI = script.Storage.UserInterface:Clone()
for i,v in pairs(Controllers) do
if v:IsA("Model") then
UI.Boot.Visible = false
UI.Errors.Visible = true
UI.Errors.Errors.HttpRequests.Visible = true
UI.Parent = v.Monitor.PCFrame.LCDScreen
end
end
end
This is the code, I’m new to scripting and It’s probably something really simple but I can’t figure it out.
You’re only calling clone one time, therefore only one clone is created. The clone will be parented to the first gui, but since you’re referencing the same clone in the loop instead of creating a new one, it will be moved to the second gui the next time the loop runs.
Simply move the clone statement into the loop and you should be good!