|
| 02 Sep 2011 07:37 PM |
while wait() do stoof = game.Players:GetChildren() for i = 1, #stoof do if stoof[i]:FindFirstChild("Humanoid") then local walky = stoof[i].leaderstats.WalkSpeed stoof[i].Humanoid.Walkspeed = walky.Value end end end
It's supposed to set the player's walkspeed to the value in the leaderboards, but doesn't. Can anyone help me on this? |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|
|
| 02 Sep 2011 07:40 PM |
| Only way I "thought" I knew how to do this. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 02 Sep 2011 07:42 PM |
1) A while loop? D:
2) Leaderstats is in the player object.
function WaitForDescendant(par, nm) local desc = par:FindFirstChild(nm, true) while not (desc and desc.Name == nm) then desc = par.DescendantAdded:wait() end return desc end
game.Players.PlayerAdded:connect(function(newPlayer) local ws = WaitForDescendant(newPlayer, "WalkSpeed") ws.Changed:connect(function(val) if newPlayer.Character and newPlayer.Character:FindFirstChild("Humanoid") then newPlayer.Character.Humanoid.WalkSpeed = val end end) end) |
|
|
| Report Abuse |
|
|