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

How can I make a script that takes a person's clothes/hats and clones it inside a NPC?

Asked by 5 years ago

Trying to make an NPC that disguises as a random person ingame by cloning their clothes and hats and putting it inside said NPC? Here is what I was thinking of:

m = game.Players:GetChildren()
Player = m[math.random(1,#m)]




Player.Pants:Clone().Parent = game.Workspace.NPC
Player.Shirts:Clone().Parent = game.Workspace.NPC

Any help will be appreciated.

0
Also ignore Shirts as I meant to put Shirt. ErskinePierre 48 — 5y
0
Why don't you just clone them? WideSteal321 773 — 5y
0
What do you mean by that? I did. ErskinePierre 48 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Never mind, I answered my own question. Heres the script if anyone needs it.

game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) char:WaitForChild("Shirt" and "Pants") char.Archivable = true local d = char.Shirt local s = char.Pants

    d:Clone().Parent = game.Workspace.Flanker

    s:Clone().Parent = game.Workspace.Flanker



end)
end)

Replace Flanker with the name of the NPC.

Also local d and local s can be replaced. For example local s = char:Clone()

Ad

Answer this question