so ``function addSword(player) local backpack = player:WaitForChild("Backpack") local sword = game.ServerStorage.ClassicSword:Clone() sword.Parent = backpack end
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:Connect(addSword()) end)``
This code doesn't work
but
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:Connect(function()
local backpack = player:WaitForChild("Backpack")
local sword = game.ServerStorage.ClassicSword:Clone()
sword.Parent = backpack
end)
end)
this does, why is that?
"connect" is deprecated. Use "Connect" instead.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(addSword) end)
You don't have to insert the ()