DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
|
| 23 Feb 2014 10:20 AM |
Okay, my problem here is that I have no idea to make this script apply to all players. I've done game.Players:getchildren(), but I don't know where to go from there... Thanks in advance
game.Workspace.Player.Humanoid.Running:connect(function(speed) if speed > 0 then game.Workspace.Zombie.Humanoid.Walkspeed = 21 else game.Workspace.Zombie.Humanoid.Walkspeed = 15 end end) |
|
|
| Report Abuse |
|
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
|
| 23 Feb 2014 10:25 AM |
Is this what you want?
game.Players.PlayerAdded:connect(function(player) player.Character.Humanoid.Running:connect(function(speed) if speed > 0 then game.Workspace.Zombie.Humanoid.Walkspeed = 21 else game.Workspace.Zombie.Humanoid.Walkspeed = 15 end end) end) |
|
|
| Report Abuse |
|
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
|
| 23 Feb 2014 10:33 AM |
| It doesn't seem to work. There's no output either. :/ |
|
|
| Report Abuse |
|
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
Ekkoh
|
  |
| Joined: 22 Oct 2012 |
| Total Posts: 524 |
|
|
| 23 Feb 2014 10:37 AM |
Try this out.
local Players = Game:GetService("Players") local Zom = Workspace.Zombie.Humanoid
function PlayerAdded(plr) plr.CharacterAdded:connect(function(char) char:WaitForChild("Humanoid").Running:connect(function(speed) if speed > 0 then Zom.WalkSpeed = 21 else Zom.WalkSpeed = 15 end end) end) end
for _, plr in pairs(Players:GetPlayers()) do PlayerAdded(plr) plr:LoadCharacter() end
Players.PlayerAdded:connect(PlayerAdded)
"We can walk a million miles, and end up in the sea." - George Ragan aka Johnny 3 Tears |
|
|
| Report Abuse |
|
|
ToboboT
|
  |
| Joined: 25 Jun 2011 |
| Total Posts: 2385 |
|
|
| 23 Feb 2014 10:38 AM |
umm this will seem as if the player's walkspeed never changes you know that right?
running fire everytime the walkspeed changes I am pretty sure |
|
|
| Report Abuse |
|
|
Ekkoh
|
  |
| Joined: 22 Oct 2012 |
| Total Posts: 524 |
|
|
| 23 Feb 2014 10:38 AM |
Nice shirt btw :P
"We can walk a million miles, and end up in the sea." - George Ragan aka Johnny 3 Tears |
|
|
| Report Abuse |
|
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
|
| 23 Feb 2014 10:38 AM |
| I don't quite understand what you want to happen here, do you want this script to run for each player? |
|
|
| Report Abuse |
|
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
|
| 23 Feb 2014 10:41 AM |
@ekkoh It doesn't work, but thank you for the shirt compliment. :3 @curry Yes. |
|
|
| Report Abuse |
|
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
|
| 23 Feb 2014 10:43 AM |
| I would put it in a localscript that is copied into the starterpack or somewhere like that (just so it can get to .Character.Humanoid) and then have it run like that. |
|
|
| Report Abuse |
|
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|