Duplicate items in StarterGUI?

I have a model that I want to make more copies of. But the model gets its functions and features from StarterGUI, and the scripts in StarterGUI state for example:

local part7 = workspace:WaitForChild("p3")

and so on. Does anyone have a solution or alternative to this?

My whole brain doesn’t work :slight_smile: (it’s too late in Argentina), could you describe better what you want to do?

I have a model, that has functions in StarterGUI, but I want to duplicate the model, the way I scripted it is how the example I put above is.

Do you want to duplicate it from the StarterGui? Remember that everything in StarterGui is cloned locally in PlayerGui, within each player.
In case you want to duplicate it, but not from the StarterGui, or copy and paste, I don’t see what the problem would be.

If I am not understanding something, I apologize.

If you mean you want to clone things in a player’s StarterGui, this might help.

CODE SAMPLE

local StarterGui = game:GetService("StarterGui")
local guiToDuplicate = StarterGui:WaitForChild("p3")

local duplicatedGui = guiToDuplicate:Clone()
duplicatedGui.Parent = newParent -- change newParent to wherever you wish for it to be cloned into

Otherwise, parent the GUI to a new script and make it so that whenever the player “starts” it is placed into PlayerGui but can also be used for other purposes.

KEY FUNCTIONS

  • :Clone()

No no, I have a model that has functions in StarterGUI, but those functions are linked to that one model from this

 local lost = workspace:WaitForChild("lost")
    local part2 = workspace:WaitForChild("lost")
	local part3 = workspace:WaitForChild("click")
	local part4 = workspace:WaitForChild("Partee")
	local part5 = workspace:WaitForChild("p1")
	local part6 = workspace:WaitForChild("p2")

If I want to make more copies of that model, with the same functions what do I do?

No no, I have a model that has functions in StarterGUI, but those functions are linked to that one model from this

 local lost = workspace:WaitForChild("lost")
    local part2 = workspace:WaitForChild("lost")
	local part3 = workspace:WaitForChild("click")
	local part4 = workspace:WaitForChild("Partee")
	local part5 = workspace:WaitForChild("p1")
	local part6 = workspace:WaitForChild("p2")

If I want to make more copies of that model, with the same functions what do I do?

Being honest, (not knowing what you want to do completely) I don’t understand why a workspace model has functions in the client (StarterGui / PlayerGui). But I guess copying the functions for each model should work.

I leave you some basic articles from the Developers Wiki, in case you need them. I don’t think you need them, but just in case.


Sorry I haven’t been helpful, but I haven’t understood you at all.

To be honest, I’m not sure what you are doing.

Could you better explain the reasons behind using a LocalScript to control things in the workspace?

Unless this was intentional, these effects will only occur on the current client so I daresay using a normal Script may be more useful.

If this is because you have a need to also manipulate UI, just create the UI (via script or studio tools, then parent the ScreenGui to a script) and then perform the functions you require to happen. If your method involves vital parts that may change the game should they be changed or modified, do it on a normal Script as you should never trust the client.