Minigame [Help]

I am trying to clone a tool and give it to everyone when the minigame starts but i have no idea how to do that, if i do it in a global script it only gives it to the first player to join because it clones when a player is added.

any idea on how to clone a tool and give it to everyone instead of the first player?

To give everyone a tool, you would have to loop through all of the Player’s in the game, and :Clone them each an item.
Example function:

--Server Script
function GiveAllPlayersTool(Tool)
    for key, Player in pairs(game.Players:GetChildren()) do
        NewTool = Tool:Clone()
        NewTool.Parent = Player.Backpack
    end
end

GiveAllPlayersTool(game.ServerStorage.Tool) -- pass the tool to be cloned as the parameter
1 Like

Thanks I didn’t know you could loop through every player. The more you know.

1 Like