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

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

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your 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
Ad

Answer this question