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: Any way to do while touching?

Previous Thread :: Next Thread 
Matthais5 is not online. Matthais5
Joined: 19 Apr 2012
Total Posts: 6520
21 Mar 2016 12:59 PM
Something like while the player is standing on a brick, he/she gets extra movespeed, but ONLY WHILE they're standing on the brick. The moment they step off the brick they lose the movespeed boost.

I know there's a way to do it by constantly checking the player's CFrame, but that requires a while true loop which seems terribly inefficient.

The only thing I can think of is making a ring around the part with its own onTouched script that reverts a player back to 16 walkspeed the moment he/she touches the ring. This doesn't seem terribly inefficient, but it also doesn't seem ideal (there seems to be many ways it could go wrong).

Thoughts? Ideas?
Report Abuse
gracey1212 is not online. gracey1212
Joined: 11 Jun 2012
Total Posts: 86
22 Mar 2016 05:01 PM
script.Parent.Touched:connect(funtion(hit)
hit.Parent.Humanoid.WalkSpeed = AMOUNT
End


script.Parent.TouchEnd:connect(function(hit)
Hit.Parent.Humanoid.WalkSpeed = 16
end


They might be wrong with some bugs..
Report Abuse
belial52 is not online. belial52
Joined: 10 Oct 2009
Total Posts: 8074
22 Mar 2016 05:02 PM
Do a region3 above the part and check if they're in it.
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