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

How do I clone things into a players backpack?

Asked by
Yeevivor4 155
9 years ago
local part = game.Workspace.Part
while true do
    for i,v in pairs(game.Players:GetChildren()) do
        if (v.Character.Torso.Position - part.Position).magnitude <= 15 then
            c = game.Workspace.Part:Clone()
            c.Parent = Workspace
            break
        end
    end

    wait()
    end

I am trying to make it so that, if someone goes into the range of the "Object", they will receive a tool. Thank you for reading.

1 answer

Log in to vote
0
Answered by
wjs3456 90
9 years ago

You are really close. Just do this:

c = game.Workspace.Part:clone()--clone may have to be lower case. I'm not positive.
c.Parent = v.Backpack
--Also if you would prefer to keep it in there even if they die use
c.Parent = v.StarterGear
--You will have to clone this again of course

Hope to help

Ad

Answer this question