generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would I select all the players?

Previous Thread :: Next Thread 
max659 is not online. 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 is not online. max659
Joined: 01 Nov 2009
Total Posts: 84
07 Aug 2015 09:10 PM
Anyone?
Report Abuse
Voidacity is not online. 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 is not online. max659
Joined: 01 Nov 2009
Total Posts: 84
07 Aug 2015 09:16 PM
Thanks for the help
Report Abuse
Voidacity is not online. Voidacity
Joined: 05 Nov 2009
Total Posts: 15759
07 Aug 2015 09:18 PM
Your welcome!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image