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

How do I clone things into a players backpack?

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

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

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