I made a sword giver script that give everybody in the server a sword, but when the function fires instead of everybody getting one sword it gives everyone gets a number of swords depending on how many players are in the server, so for example if there are 3 people in the server everybody gets 3 swords and if there are 15 people in the server everybody gets 15 swords.

This is the code I used:

swords = function()
	for _,player in ipairs(game.Players:getChildren()) do
 local tool = game.Lighting.sword:clone()
 tool.Parent = player.Backpack
	end
end

1 comment

0

you tried to set a limit to the sword to each player?