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
 

Slowing a player

Previous Thread :: Next Thread 
BamRulez is not online. BamRulez
Joined: 18 Sep 2010
Total Posts: 239
11 Oct 2014 01:52 PM
function onTouch(hit)
local h = script.Parent:FindFirstChild("Humanoid")
if h == nil then
return
end

h.Walkspeed = 5
end

script.Parent.Touched:connect(onTouch)

-- Is "Walkspeed" the correct term to change their speed?
Report Abuse
Verodoxys is not online. Verodoxys
Joined: 29 Jun 2012
Total Posts: 18454
11 Oct 2014 01:54 PM
>h.Walkspeed = 5

This should be:

h.WalkSpeed = 5
Report Abuse
BamRulez is not online. BamRulez
Joined: 18 Sep 2010
Total Posts: 239
11 Oct 2014 01:59 PM
function onTouch(hit)
local h = script.Parent:FindFirstChild("Humanoid")
if h == nil then
return
end

h.WalkSpeed = 5
end

script.Parent.Touched:connect(onTouch)

-- Still doesn't work.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
11 Oct 2014 02:03 PM
'local h = script.Parent:FindFirstChild("Humanoid")'

um


script.Parent.Touched:connect(function(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = 5
end
end)
Report Abuse
BamRulez is not online. BamRulez
Joined: 18 Sep 2010
Total Posts: 239
11 Oct 2014 02:06 PM
Thanks that worked.
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