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?
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?
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
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
I do have a question. at "yourtoolnamehere" is it the id or name
Just the name of the thing in Lighting (Although I personally would use ReplicatedStorage instead of Lighting, but that's a long story).