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

Help with Clone method?

Asked by 10 years ago
local Officer = game.ReplicatedStorage.Characters.Officer

local Cloned = false

local Cops = {Officer}

HuntersSelected = {}

CopsSelected = {}

local SelcCop = nil

local SelcHunters = nil

function CopSelect()

    for i, v in pairs(Cops) do

        if game.Players.NumPlayers >= 2 and game.Players.NumPlayers <= 12 then

            SelcCop = game.Players:GetChildren()[math.random(1, game.Players.NumPlayers)]

            print("Chosen Cops are "..SelcCop.Name..".")

    for _,l in pairs(SelcCop.Character:GetChildren()) do

        if l:IsA("CharacterAppearance") or l:IsA("Hat") then

        l:Destroy()

        print("Stuff destroyed")

        end

    end

end

                            for _,Aper in pairs(Officer:GetChildren()) do

                                if Aper:IsA("CharacterMesh") or Aper:IsA("Hat") then

                                    if not Cloned then

                                     cloneoff =  Officer:Clone()

                                    end
                                        if SelcCop ~= nil then

                                        cloneoff.Parent = SelcCop.Character

                                        Cloned = true

                                        wait(2)

                                        Cloned = false

                end

            end

        end

    end

end

CopSelect()

It clones the officer's children, but it doesn't clone it to the player.

Answer this question