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

How to give players tools using scripts?

Hey guys! I'm making a game and I need some code that would give every player in the game a certain tool (From lighting preferably)

Any help?

1 answer

Are you trying to give every player currently in-game a tool at a given moment? If so, simply iterate over game.Players and clone the tool into everyone's Backpack, like so:

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

2 comments

0

I do have a question. at "yourtoolnamehere" is it the id or name

0

Just the name of the thing in Lighting (Although I personally would use ReplicatedStorage instead of Lighting, but that's a long story).

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