Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is this folder not being cloned to playerGui?

Local script in screenGui. The script does everything EXCEPT clones the GUIs. What am I doing wrong? It removes the entire GUI like it should, but it's like it just completely looks over the cloning and does nothing with it.

repeat
	wait()
until game.Players.LocalPlayer.Character ~= nil

player = game.Players.LocalPlayer

script.Parent.Play.MouseButton1Down:Connect(function()
	script.Parent.Play:TweenPosition(UDim2.new(-2, 0, .423, 0, "Out", "Quad", 1, true))
	script.Parent.Help:TweenPosition(UDim2.new(-2, 0, .6, 0, "Out", "Quad", 1, true))
	script.Parent.Credits:TweenPosition(UDim2.new(-2, 0, .776, 0, "Out", "Quad", 1, true))

	player.Character.UpperTorso.CFrame = CFrame.new(Vector3.new(37.714, 7.159, 168.844))

	wait(.1)

	local Ncam = workspace.Camera
	Ncam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
	Ncam.CameraType = "Custom"
	
	wait(.5)
	
	local t = game.ReplicatedStorage.PlayerInterface:Clone(player.PlayerGui)
	local debugger = player.PlayerGui:FindFirstChild('Debug')
	debugger.Interface.Value = 'HasInterface'
	
	wait(1)
	
	script.Parent:remove()
	--end
end)

2 comments

0

I fixed the indentation, and put the code in a code block.

0

quick tip when you use CFrame you dont need to use Vector3 as shown in your script, you could simply just have typed player.Character.UpperTorso.CFrame = CFrame.new(37.714, 7.159, 168.844)

1 answer

✓ Accepted answer

Setting the parent cannot be done within the parentheses as a parameter, though is actually meant to be done by writing .Parent after the parentheses instead. This shouldn't be done in the form you've written it though as you've created this Clone to be returned to a variable for reference; this measure cannot be done if this is the scenario.

Simply just call the same line without the variable declaration or drop a line to set the Parent instead.

script.Part:Clone().Parent = workspace.

This discussion is preserved as it was. New answers, comments, and votes are closed.