max659
|
  |
| Joined: 01 Nov 2009 |
| Total Posts: 84 |
|
|
| 07 Aug 2015 09:07 PM |
| I am trying to select all the players and give them all a sword but I don't know how I would do it. I thought about using a LocalScript but I don't know what to do after that |
|
|
| Report Abuse |
|
|
max659
|
  |
| Joined: 01 Nov 2009 |
| Total Posts: 84 |
|
| |
|
Voidacity
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15759 |
|
|
| 07 Aug 2015 09:10 PM |
Assuming sword is a tool/hopperbin and you already assigned it.
for _, player in ipairs(game.Players:GetPlayers()) do sword:Clone().Parent = player.Backpack end
If you want it to even affect players that join the game.
local function giveSword(player) sword:Clone().Parent = player:WaitForChild("Backpack") end
for _, player in ipairs(game.Players:GetPlayers()) do giveSword(player) end game.Players.PlayerAdded:connect(giveSword) |
|
|
| Report Abuse |
|
|
max659
|
  |
| Joined: 01 Nov 2009 |
| Total Posts: 84 |
|
| |
|
Voidacity
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15759 |
|
| |
|