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

Cloning into a table?

Asked by 11 years ago

It's supposed to clone the children of Officer into the players that are cops. Help would be appreciated

01local Hunters = {}
02local Cops = {}
03 
04local Officer = game.Workspace.Characters.Officer:GetChildren()
05 
06local Players = game.Players:GetChildren()
07 
08for i,v in pairs(Players) do
09table.insert(Hunters,v)
10end
11 
12function chooseRandomPlayer(fromTeam,toTeam)
13    local randomPlayer = nil
14    repeat
15        randomPlayer = fromTeam[math.random(1,#fromTeam)]
View all 32 lines...
0
Please explain what you want the code to do. At a glance, it's not really possible to determine what you *expect* is supposed to happen. adark 5487 — 11y
1
there edited it to explain better. TREVOR818730 25 — 11y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
11 years ago

Try this in place of lines 24-26:

1for _, cop in Cops do
2    for _, bit in Officer do
3        bit:Clone().Parent = cop
4    end
5end
0
I'm not checking to see if it exist, I'm trying to clone the charactermeshes and the hat into the players that are picked as cops. TREVOR818730 25 — 11y
Ad

Answer this question