Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to get every accessories on player, then clone them ?

How can I to get all accessories from a player character and then clone them somewhere else? I tried some scripts but they gave me errors.

1 answer

✓ Accepted answer

Here is code for Local Script:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
wait(2)

for i,v in pairs(Player.Character:GetChildren()) do
	if v:IsA("Accessory") then
		local Clone = v:Clone()
		Clone.Parent = game.Workspace --set the parent here
	end
end

Here it is for a Script:

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Char)
		wait(2)
		for i,v in pairs(Char:GetChildren()) do
			if v:IsA("Accessory") then
				local Clone = v:Clone()
				Clone.Parent = game.Workspace --set the parent here
			end
		end
	end)
end)

2 comments

0

thx Gooddddd

0

accept please?

This discussion is preserved as it was. New answers, comments, and votes are closed.