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 |
|
|
|
| 03 May 2016 02:35 PM |
Use a local script and use plr = ga,e.Players.LocalPlayer instead? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 03 May 2016 07:06 PM |
| the script will active on game start or if you toggle the disabled off |
|
|
| Report Abuse |
|
|