Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this folder not being cloned to playerGui?

Asked by 5 years ago
Edited by TheeDeathCaster 5 years ago

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)
0
I fixed the indentation, and put the code in a code block. TheeDeathCaster 2368 — 5y
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) Gameplayer365247v2 1055 — 5y

1 answer

Log in to vote
1
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
5 years ago

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.
Ad

Answer this question