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

How would the person only get one item?

for i, player in ipairs(game.Players:GetChildren()) do
SS.SWeps.Sword:clone().Parent = player.Backpack
	end

When this piece of code runs people get 2 swords instead of 1. How would I fix this?

1 answer

for i, player in pairs(game.Players:GetChildren()) do
if player:FindFirstChild("Backpack")
then
SS.SWeps.Sword:clone().Parent = player:FindFirstChild("Backpack")
end
end

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