I tried my best, It shows now errors but It just wont clone it
while true do wait(0.2) local guiObject = script.Parent:Clone() -- creates a clone of parent guiObject.Position = UDim2.new(0,0, 0.2,0.1) wait(0.2) end
If you need anymore information heres a gyazo about how it looks right now
https://gyazo.com/f0ff64db533a03efbbe4a22bc8522530
I read the guidelines and only heard about bad links. if this isn't allowed, I am sorry :)
What you need to do is parent "guiObject" to the player's gui.
You are cloning it, but when you clone it is not actually ingame. The same applies to Instance.new() and many other similar functions.
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") -- Waits for the PlayerGui to load while true do wait(0.2) local screenGui = Instance.new("ScreenGui") local guiObject = script.Parent:Clone() -- creates a clone of parent 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.