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

Tool not cloning into backpack from ReplicatedStorage with script?

When I use this script


 game.Players.PlayerAdded:Connect(function(player)
	for i,v in pairs(game.Players:GetChildren(player)) do
	local someone =  v:WaitForChild(player)
		print(someone)
		if someone == "The_sandwic" then
				game.ReplicatedStorage.Keycard:Clone(someone.Backpack)
		end


end


end)

It find the player "The_sandwic" but when I run it it doesn't clone the tool into the backpack. Can someone help?

1 answer

I'm not sure if this would work, but here.

game.Players.PlayerAdded:Connect(function(player)
    for i,v in pairs(game.Players:GetChildren(player)) do
    local someone =  v:WaitForChild(player)
        print(someone)
        if someone == "The_sandwic" then
                game.ReplicatedStorage.Keycard:Clone().Parent = someone.Backpack
        end


end


end)

2 comments

0

why does he use 'for i,v in pairs(game.Players:GetChildren(player)) do' when he already has the player...

0

shhhhh

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