In this function, the two new instances (ScreenGui and Frame) are both created as they should be and when I test it in game the size is set for the Frame (as again it should be), however I cannot see the frame.
function stuff(part)
if not game.StarterGui:FindFirstChild("ScreenGui") then
local sc = Instance.new("ScreenGui", game.StarterGui)
wait (0.1)
local fr = Instance.new("Frame", game.StarterGui.ScreenGui)
game.StarterGui.ScreenGui.Frame.Size = UDim2.new{0, 100},{0, 100}
end
end
script.Parent.ClickDetector.MouseClick:connect(stuff)

3 comments
It looks like the size has been set when I check the properties whilst testing, but I still can't see it (for example, it will show up if I do it all in Studio)
Try that
@64batsalex , It is best to explain your answer to give the asker a better understanding of what's going on!