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

[SOLVED] Script only clones half of the childrens?

Asked by 2 years ago
Edited 2 years ago

So I am creating an Authentication system. Once the server script verifies that the player is entering the correct password, it clones a folder in ServerScriptService which has everything that is necessary for the system to continue working. But things didn't turn out the way I intended it to; the script only clones half of the Folders.

Server Script: (Not the entire script, only part of the block that's broken)

local c = UiFold:Clone()

wait()

for i, childs in pairs(c:GetChildren()) do
    print(i .. " | " .. childs.Name)
    childs.Parent = Panel.Main
    wait()
    Panel.Main.Authentication:Destroy()
    Panel.Main.Home.Visible = true
end

wait()

c:Destroy()

Client: (Again, not the entire script)

function AuthenticatePlayer()
    if not table.find(Admins, plr.UserId) then
        plr:Kick("\n Breach attempt has been identified \n Level 03 %err breach")
    end

    if Code.Text ~= "" then
        local Event = Authenticate:InvokeServer(Code.Text)
    end
end

Btn.MouseButton1Click:Connect(AuthenticatePlayer)

Here are a few screenshots:

Output

Workspace

PS: I've tried making the wait a little longer for the script to process it, still the same result

I tried parenting the folder into main, still the same result

Cloned Folder

1 answer

Log in to vote
0
Answered by 2 years ago

I've solved the issue. It turns out I just had to... Resort the script lines and not destroy the Authentication..? I don't really know what's happening, but it's just Roblox being Roblox, I guess.

Ad

Answer this question