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

How would I clone and then parent something in every players torso?

I know how to clone the object but I don't know how to make it clone to ALL of the players torso's What would be the best way in doing this?

Notes: I am putting this here because I can not access roblox at the moment.



--Clone the tool tip into the torso. When the user hovers over a torso, the tool tip will be shown -----(tooltip script)

local object = script.Parent.Parent.Tooltip:clone()

for i, v in pairs(game.Players:GetPlayers()) do
    if v.Character then
        object:clone().Parent = v.Character.Torso
    end
end

--When player clicks another player's torso, the profile gui becomes visible

local plr = game.Players.LocalPlayer;
local mouse = plr:GetMouse();
local Frame2 = script.Parent.Content

mouse.Button1Down:connect(function()
    if mouse.Target and mouse.Target.Parent and game.Players:GetPlayerFromCharacter(mouse.Target.Parent) then 
        Frame2.Visible = true; 
    end
end)



1 answer

✓ Accepted answer
local object = PATH_TO_ITEM:clone()

for i, v in pairs(game.Players:GetPlayers()) do
	if v.Character then
		object:clone().Parent = v.Character.Torso
	end
end

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