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 » Scripters
Home Search
 

Re: Changing a player's walkspeed when on and off a brick

Previous Thread :: Next Thread 
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
25 Sep 2016 04:25 PM
I want to be able to change a player's WalkSpeed when they walk on a brick and change it back to normal when they walk off.

I've tried Touched and TouchEnded, however, walking is wonky with both and WalkSpeed constatly fluctuates between 16 and 32 (new walkspeed) since each leg leaves the ground for a bit.

Is magnitude a viable option? I'm reluctant to use magnitude since if I put two bricks with different effects by each other they will conflict.

I might just be looking at it the wrong way and being stupid though. :P
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
25 Sep 2016 04:32 PM
Bump.
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
25 Sep 2016 04:35 PM
part.Touched


part.TouchEnded
http://wiki.roblox.com/index.php?title=API:Class/BasePart#EventsmemberhiddenEvents_.5Btoggle.5D
Report Abuse
kayak503 is not online. kayak503
Joined: 09 Dec 2013
Total Posts: 11
25 Sep 2016 04:58 PM
Wunder_Wulfe has the idea but i will right a script for you

script.Parent.Touched:connect(function(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
human.WalkSpeed = human.WalkSpeed+5
wait(5)
end
end)


script.Parent.TouchEnded:connect(function(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
human.WalkSpeed = human.WalkSpeed-5
end
end)


Report Abuse
kayak503 is not online. kayak503
Joined: 09 Dec 2013
Total Posts: 11
25 Sep 2016 05:00 PM
and make to block uncollidable and in air
Report Abuse
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
25 Sep 2016 05:24 PM
.magnitude > .Touched
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
25 Sep 2016 05:45 PM
why do people assume that the humanoid is in the player

In Normal Script:
local player = game.Players.PlayerName

function Touched()
player.Character.Humanoid.Walkspeed = 30
end

function TouchedEnded()
player.Character.Humanoid.Walkspeed = 16
end

Part.TouchEnded:connect(TouchedEnded)
Part.Touched:connect(Touched)

----------------------------------------------

In Local script:
local player = game.Players.PlayerName

function Touched()
player.Character.Humanoid.Walkspeed = 30
end

function TouchedEnded()
player.Character.Humanoid.Walkspeed = 16
end

Part.TouchEnded:connect(TouchedEnded)
Part.Touched:connect(Touched)

Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
25 Sep 2016 05:47 PM
in local script:
local player = game.Players.LocalPlayer

function Touched()
player.Character.Humanoid.Walkspeed = 30
end

function TouchedEnded()
player.Character.Humanoid.Walkspeed = 16
end

Part.TouchEnded:connect(TouchedEnded)
Part.Touched:connect(Touched)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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