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 » Scripting Helpers
Home Search
 

Re: Team Walkspeed Script

Previous Thread :: Next Thread 
KNEXFREEK354 is not online. KNEXFREEK354
Joined: 27 Apr 2009
Total Posts: 654
12 Apr 2013 08:41 PM
Hello, I have been working on a project and require a script. How would I write a script that would change a certain teams walkspeed to a certain value? Thank you.
Report Abuse
coolikevin22 is not online. coolikevin22
Joined: 21 Feb 2011
Total Posts: 450
12 Apr 2013 09:01 PM
I know how to do this.. But this is not a forum to give away scripts, so go read the wiki, and make it yourself :)
Report Abuse
Destiny1147 is not online. Destiny1147
Joined: 08 Jun 2011
Total Posts: 699
13 Apr 2013 01:23 AM
c = game.Players:GetChildren()

for i = 1, #c do
if c.TeamColor = game.Teams["TEAM NAME HERE"].TeamColor then
c[i].Character.Humanoid.WalkSpeed = SPEED HERE
end
end
Report Abuse
KNEXFREEK354 is not online. KNEXFREEK354
Joined: 27 Apr 2009
Total Posts: 654
13 Apr 2013 05:01 PM
The script does not appear to work for some reason, what is the problem?
Report Abuse
Destiny1147 is not online. Destiny1147
Joined: 08 Jun 2011
Total Posts: 699
14 Apr 2013 01:44 AM
Found the error, fixed:


c = game.Players:GetChildren()

for i = 1, #c do
if c[i].TeamColor = game.Teams["TEAM NAME HERE"].TeamColor then
c[i].Character.Humanoid.WalkSpeed = SPEED HERE
end
end
Report Abuse
KNEXFREEK354 is not online. KNEXFREEK354
Joined: 27 Apr 2009
Total Posts: 654
14 Apr 2013 12:04 PM
I have tried the fixed script, however there is an error. Studio underlines in red the line for i = 1, #c do. How would we fix this?
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
14 Apr 2013 12:10 PM
go to the error hover over it and it will tell you what is wrong.
Report Abuse
ForceSky is not online. ForceSky
Joined: 30 Jul 2012
Total Posts: 2379
14 Apr 2013 12:38 PM
Here, if you want the walkspeed to be changed when they join, use this:

function onPlayerAdded(plr)
if plr.TeamColor == ("TEAMCOLORGOESHERE") then
plr.Character.Humanoid.Walkspeed = WALKSPEEDNUMBERGOESHERE
end
game.Players.ChildAdded:connect(onPlayerAdded)
Report Abuse
KNEXFREEK354 is not online. KNEXFREEK354
Joined: 27 Apr 2009
Total Posts: 654
14 Apr 2013 01:10 PM
What would happen if they spawn on the team with walkspeed 16, then join the slower? Or the other way around? Does this malfunction when I test in studio?
Report Abuse
ForceSky is not online. ForceSky
Joined: 30 Jul 2012
Total Posts: 2379
14 Apr 2013 06:45 PM
Unless teamchange is on, people can't change teams. You could also just set the property when a player changes teams.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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