Gui cloning issue

when I clone my GUI on a ClickDectector it go overtop my UI in it don’t go to My position I want it to go to here a screen shot in script

local ClickDetector = script.Parent.ClickDetector
local Door = game.Workspace.Door12

ClickDetector.MouseClick:Connect(function(player)
	local mainFrame = player.PlayerGui.MainFrame
	local jobFrame = mainFrame.Job

	local newJobFrame = jobFrame:Clone()

	newJobFrame.Parent = mainFrame

	newJobFrame.Visible = true

	newJobFrame.Username.Text = player.Name
	newJobFrame.Room.Text = Door.Roomnumber.Value

	newJobFrame.Position = UDim2.new(0, 481, 0, 26)
end)

Try changing the zindex.

For your issue with it going ontop of another UI Object, cookie is correct, change the Z Index.

As for position, I notice your using Offset, which isn’t reccomended, I reccomend using Scale instead of offset. (So something with an anchor point of 0.5,0.5 and a Position Udim2 of 0.5,0,0.5,0 would be in the middle)
Whereas offset is a static set of numbers, the Scale object utalises the screen width and its better for UI for all devices.

For the UI problem with the housekeeping system, its that I assume its not being parented correctly. The blue looks like the container, so parent it there. I do suggest parenting it there. I also reccomend using UIListLayout for more consistant list type content.

If you have any questions don’t hesatate to ask!

what should the z index should be set to

update to my script I got it to clone on the UI but when there another issue where it won’t clone It under the first button here a video of an example of what it does when i click both buttons
Uploading: robloxapp-20240711-0321109.mp4…
in here the updated code with the new changes `local ClickDetector = script.Parent.ClickDetector
local Door = game.Workspace.Door13

ClickDetector.MouseClick:Connect(function(player)
local mainFrame = player.PlayerGui.MainFrame
local jobFrame = mainFrame.Job

local newJobFrame = jobFrame:Clone()

newJobFrame.Parent = mainFrame

newJobFrame.Visible = true

newJobFrame.Username.Text = player.Name
newJobFrame.Room.Text = Door.Roomnumber.Value

local frameCount = #mainFrame:GetChildren()
newJobFrame.Position = UDim2.new({0.513, -275},{0.702, -175} * frameCount)
end)`

Use a UIListLayout for that

when I use UIListLayout on my frame when I try duplicate it moves my frame in It duplIcate it on top of the frame instead of the direction I need it to go in here an picture of what it does
Screenshot 2024-07-11 222710

Because i dont think you have ClipDiscendants enabled for your frame, are you using a ScrollingFrame or not?

I’m not using a ScrollingFrame

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.