Hello. Here is a more explained version of Raccoonyz's answer.
When a player is added, an object/instance gets created inside the player called PlayerGui. It is the container for the guis the player has on-screen. The guis that get cloned are inside StarterGui, another container.
So, you must parent the cloned gui to the PlayerGui.
Also, you must first create a ScreenGui and then put the object in it as TextLabels that aren't parented to a ScreenGui will not show up on-screen.
Add this code to the script (make sure it's a LocalScript):
game.Players.LocalPlayer:WaitForChild("PlayerGui")
while true do
wait(0.2)
local screenGui = Instance.new("ScreenGui")
local guiObject = script.Parent:Clone()
guiObject.Position = UDim2.new(0,0, 0.2,0.1)
guiObject.Parent = screenGui
screenGui.Parent = game.Players.LocalPlayer.PlayerGui
wait(0.2)
end
Also, when you use Clone(), the object is made but not parented. To parent it, you must use the "Parent" property.
3 comments
I dont understand how to do that...
Which gui, do you mean the scrolling frame???
guiObject.Parent = ParentObject.