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 do I set this script to all?

Previous Thread :: Next Thread 
Biassed is not online. Biassed
Joined: 31 Jan 2013
Total Posts: 24
03 May 2016 02:33 PM
How would I set it so instead of one player, it will do it to the whole server or others?

ex
plr = game.Players.USERNAME
plr.Data1.lvl.Value=1



Report Abuse
DeathbringerDev is not online. DeathbringerDev
Joined: 03 Sep 2014
Total Posts: 35
03 May 2016 02:35 PM
Use a local script and use plr = ga,e.Players.LocalPlayer
instead?
Report Abuse
Biassed is not online. Biassed
Joined: 31 Jan 2013
Total Posts: 24
03 May 2016 02:38 PM
How would I set it so it would affect the WHOLE server.


Report Abuse
dylan1406599 is not online. dylan1406599
Joined: 30 Apr 2008
Total Posts: 197
03 May 2016 02:40 PM
for i,v in pairs(game.Players:GetChildren())
local plr = v.Name
plr.Data1.lvl.Value = 1
end
Report Abuse
dylan1406599 is not online. dylan1406599
Joined: 30 Apr 2008
Total Posts: 197
03 May 2016 02:42 PM
but that will only work once for everyone on the server so do

game.Players.PlayerAdded:connect(function(player)
player.Data1.lvl.Value=1
end)
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
03 May 2016 02:42 PM
You need to use a loop to go through a list (table) of players. You get the list using 'game.Players:GetPlayers()' and you can use a 'for' loop to go through it.

for numberIndex, playerObject in pairs(game.Players:GetChildren()) do
--numberIndex is their position in the table
--playerObject is the Player
playerObject = game.Players.USERNAME
playerObject.Data1.lvl.Value = 1
end
Report Abuse
xEnforcer is not online. xEnforcer
Joined: 03 Jun 2011
Total Posts: 1077
03 May 2016 02:43 PM
op isn't being clear

do you only want it done once to everyone or,

when someone joins the server, then change their lvl?

both have multiple methods
Report Abuse
Biassed is not online. Biassed
Joined: 31 Jan 2013
Total Posts: 24
03 May 2016 06:44 PM
I want it done with the script activates. All done at once. So ex

plr = game.Players.USERNAME
plr.Data1.lvl.Value=1
plr.Data1.melee.Value=0



Report Abuse
dylan1406599 is not online. dylan1406599
Joined: 30 Apr 2008
Total Posts: 197
03 May 2016 07:06 PM
the script will active on game start or if you toggle the disabled off
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